proteus  1.7.3.dev0
C/C++/Fortran libraries
cpartitioning.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.21 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6  #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8  #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_29_21"
11 #define CYTHON_HEX_VERSION 0x001D15F0
12 #define CYTHON_FUTURE_DIVISION 0
13 #include <stddef.h>
14 #ifndef offsetof
15  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #endif
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
18  #ifndef __stdcall
19  #define __stdcall
20  #endif
21  #ifndef __cdecl
22  #define __cdecl
23  #endif
24  #ifndef __fastcall
25  #define __fastcall
26  #endif
27 #endif
28 #ifndef DL_IMPORT
29  #define DL_IMPORT(t) t
30 #endif
31 #ifndef DL_EXPORT
32  #define DL_EXPORT(t) t
33 #endif
34 #define __PYX_COMMA ,
35 #ifndef HAVE_LONG_LONG
36  #if PY_VERSION_HEX >= 0x02070000
37  #define HAVE_LONG_LONG
38  #endif
39 #endif
40 #ifndef PY_LONG_LONG
41  #define PY_LONG_LONG LONG_LONG
42 #endif
43 #ifndef Py_HUGE_VAL
44  #define Py_HUGE_VAL HUGE_VAL
45 #endif
46 #ifdef PYPY_VERSION
47  #define CYTHON_COMPILING_IN_PYPY 1
48  #define CYTHON_COMPILING_IN_PYSTON 0
49  #define CYTHON_COMPILING_IN_CPYTHON 0
50  #undef CYTHON_USE_TYPE_SLOTS
51  #define CYTHON_USE_TYPE_SLOTS 0
52  #undef CYTHON_USE_PYTYPE_LOOKUP
53  #define CYTHON_USE_PYTYPE_LOOKUP 0
54  #if PY_VERSION_HEX < 0x03050000
55  #undef CYTHON_USE_ASYNC_SLOTS
56  #define CYTHON_USE_ASYNC_SLOTS 0
57  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58  #define CYTHON_USE_ASYNC_SLOTS 1
59  #endif
60  #undef CYTHON_USE_PYLIST_INTERNALS
61  #define CYTHON_USE_PYLIST_INTERNALS 0
62  #undef CYTHON_USE_UNICODE_INTERNALS
63  #define CYTHON_USE_UNICODE_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_WRITER
65  #define CYTHON_USE_UNICODE_WRITER 0
66  #undef CYTHON_USE_PYLONG_INTERNALS
67  #define CYTHON_USE_PYLONG_INTERNALS 0
68  #undef CYTHON_AVOID_BORROWED_REFS
69  #define CYTHON_AVOID_BORROWED_REFS 1
70  #undef CYTHON_ASSUME_SAFE_MACROS
71  #define CYTHON_ASSUME_SAFE_MACROS 0
72  #undef CYTHON_UNPACK_METHODS
73  #define CYTHON_UNPACK_METHODS 0
74  #undef CYTHON_FAST_THREAD_STATE
75  #define CYTHON_FAST_THREAD_STATE 0
76  #undef CYTHON_FAST_PYCALL
77  #define CYTHON_FAST_PYCALL 0
78  #undef CYTHON_PEP489_MULTI_PHASE_INIT
79  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80  #undef CYTHON_USE_TP_FINALIZE
81  #define CYTHON_USE_TP_FINALIZE 0
82  #undef CYTHON_USE_DICT_VERSIONS
83  #define CYTHON_USE_DICT_VERSIONS 0
84  #undef CYTHON_USE_EXC_INFO_STACK
85  #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87  #define CYTHON_COMPILING_IN_PYPY 0
88  #define CYTHON_COMPILING_IN_PYSTON 1
89  #define CYTHON_COMPILING_IN_CPYTHON 0
90  #ifndef CYTHON_USE_TYPE_SLOTS
91  #define CYTHON_USE_TYPE_SLOTS 1
92  #endif
93  #undef CYTHON_USE_PYTYPE_LOOKUP
94  #define CYTHON_USE_PYTYPE_LOOKUP 0
95  #undef CYTHON_USE_ASYNC_SLOTS
96  #define CYTHON_USE_ASYNC_SLOTS 0
97  #undef CYTHON_USE_PYLIST_INTERNALS
98  #define CYTHON_USE_PYLIST_INTERNALS 0
99  #ifndef CYTHON_USE_UNICODE_INTERNALS
100  #define CYTHON_USE_UNICODE_INTERNALS 1
101  #endif
102  #undef CYTHON_USE_UNICODE_WRITER
103  #define CYTHON_USE_UNICODE_WRITER 0
104  #undef CYTHON_USE_PYLONG_INTERNALS
105  #define CYTHON_USE_PYLONG_INTERNALS 0
106  #ifndef CYTHON_AVOID_BORROWED_REFS
107  #define CYTHON_AVOID_BORROWED_REFS 0
108  #endif
109  #ifndef CYTHON_ASSUME_SAFE_MACROS
110  #define CYTHON_ASSUME_SAFE_MACROS 1
111  #endif
112  #ifndef CYTHON_UNPACK_METHODS
113  #define CYTHON_UNPACK_METHODS 1
114  #endif
115  #undef CYTHON_FAST_THREAD_STATE
116  #define CYTHON_FAST_THREAD_STATE 0
117  #undef CYTHON_FAST_PYCALL
118  #define CYTHON_FAST_PYCALL 0
119  #undef CYTHON_PEP489_MULTI_PHASE_INIT
120  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121  #undef CYTHON_USE_TP_FINALIZE
122  #define CYTHON_USE_TP_FINALIZE 0
123  #undef CYTHON_USE_DICT_VERSIONS
124  #define CYTHON_USE_DICT_VERSIONS 0
125  #undef CYTHON_USE_EXC_INFO_STACK
126  #define CYTHON_USE_EXC_INFO_STACK 0
127 #else
128  #define CYTHON_COMPILING_IN_PYPY 0
129  #define CYTHON_COMPILING_IN_PYSTON 0
130  #define CYTHON_COMPILING_IN_CPYTHON 1
131  #ifndef CYTHON_USE_TYPE_SLOTS
132  #define CYTHON_USE_TYPE_SLOTS 1
133  #endif
134  #if PY_VERSION_HEX < 0x02070000
135  #undef CYTHON_USE_PYTYPE_LOOKUP
136  #define CYTHON_USE_PYTYPE_LOOKUP 0
137  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138  #define CYTHON_USE_PYTYPE_LOOKUP 1
139  #endif
140  #if PY_MAJOR_VERSION < 3
141  #undef CYTHON_USE_ASYNC_SLOTS
142  #define CYTHON_USE_ASYNC_SLOTS 0
143  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144  #define CYTHON_USE_ASYNC_SLOTS 1
145  #endif
146  #if PY_VERSION_HEX < 0x02070000
147  #undef CYTHON_USE_PYLONG_INTERNALS
148  #define CYTHON_USE_PYLONG_INTERNALS 0
149  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150  #define CYTHON_USE_PYLONG_INTERNALS 1
151  #endif
152  #ifndef CYTHON_USE_PYLIST_INTERNALS
153  #define CYTHON_USE_PYLIST_INTERNALS 1
154  #endif
155  #ifndef CYTHON_USE_UNICODE_INTERNALS
156  #define CYTHON_USE_UNICODE_INTERNALS 1
157  #endif
158  #if PY_VERSION_HEX < 0x030300F0
159  #undef CYTHON_USE_UNICODE_WRITER
160  #define CYTHON_USE_UNICODE_WRITER 0
161  #elif !defined(CYTHON_USE_UNICODE_WRITER)
162  #define CYTHON_USE_UNICODE_WRITER 1
163  #endif
164  #ifndef CYTHON_AVOID_BORROWED_REFS
165  #define CYTHON_AVOID_BORROWED_REFS 0
166  #endif
167  #ifndef CYTHON_ASSUME_SAFE_MACROS
168  #define CYTHON_ASSUME_SAFE_MACROS 1
169  #endif
170  #ifndef CYTHON_UNPACK_METHODS
171  #define CYTHON_UNPACK_METHODS 1
172  #endif
173  #ifndef CYTHON_FAST_THREAD_STATE
174  #define CYTHON_FAST_THREAD_STATE 1
175  #endif
176  #ifndef CYTHON_FAST_PYCALL
177  #define CYTHON_FAST_PYCALL 1
178  #endif
179  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
181  #endif
182  #ifndef CYTHON_USE_TP_FINALIZE
183  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
184  #endif
185  #ifndef CYTHON_USE_DICT_VERSIONS
186  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
187  #endif
188  #ifndef CYTHON_USE_EXC_INFO_STACK
189  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
190  #endif
191 #endif
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
194 #endif
195 #if CYTHON_USE_PYLONG_INTERNALS
196  #include "longintrepr.h"
197  #undef SHIFT
198  #undef BASE
199  #undef MASK
200  #ifdef SIZEOF_VOID_P
201  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
202  #endif
203 #endif
204 #ifndef __has_attribute
205  #define __has_attribute(x) 0
206 #endif
207 #ifndef __has_cpp_attribute
208  #define __has_cpp_attribute(x) 0
209 #endif
210 #ifndef CYTHON_RESTRICT
211  #if defined(__GNUC__)
212  #define CYTHON_RESTRICT __restrict__
213  #elif defined(_MSC_VER) && _MSC_VER >= 1400
214  #define CYTHON_RESTRICT __restrict
215  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216  #define CYTHON_RESTRICT restrict
217  #else
218  #define CYTHON_RESTRICT
219  #endif
220 #endif
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
225 # else
226 # define CYTHON_UNUSED
227 # endif
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
230 # else
231 # define CYTHON_UNUSED
232 # endif
233 #endif
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
236  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
237 # else
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
239 # endif
240 #endif
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
244 # else
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
246 # endif
247 #endif
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
249 #ifdef _MSC_VER
250  #ifndef _MSC_STDINT_H_
251  #if _MSC_VER < 1300
252  typedef unsigned char uint8_t;
253  typedef unsigned int uint32_t;
254  #else
255  typedef unsigned __int8 uint8_t;
256  typedef unsigned __int32 uint32_t;
257  #endif
258  #endif
259 #else
260  #include <stdint.h>
261 #endif
262 #ifndef CYTHON_FALLTHROUGH
263  #if defined(__cplusplus) && __cplusplus >= 201103L
264  #if __has_cpp_attribute(fallthrough)
265  #define CYTHON_FALLTHROUGH [[fallthrough]]
266  #elif __has_cpp_attribute(clang::fallthrough)
267  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268  #elif __has_cpp_attribute(gnu::fallthrough)
269  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
270  #endif
271  #endif
272  #ifndef CYTHON_FALLTHROUGH
273  #if __has_attribute(fallthrough)
274  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
275  #else
276  #define CYTHON_FALLTHROUGH
277  #endif
278  #endif
279  #if defined(__clang__ ) && defined(__apple_build_version__)
280  #if __apple_build_version__ < 7000000
281  #undef CYTHON_FALLTHROUGH
282  #define CYTHON_FALLTHROUGH
283  #endif
284  #endif
285 #endif
286 
287 #ifndef __cplusplus
288  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
289 #endif
290 #ifndef CYTHON_INLINE
291  #if defined(__clang__)
292  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
293  #else
294  #define CYTHON_INLINE inline
295  #endif
296 #endif
297 template<typename T>
298 void __Pyx_call_destructor(T& x) {
299  x.~T();
300 }
301 template<typename T>
302 class __Pyx_FakeReference {
303  public:
304  __Pyx_FakeReference() : ptr(NULL) { }
305  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
306  T *operator->() { return ptr; }
307  T *operator&() { return ptr; }
308  operator T&() { return *ptr; }
309  template<typename U> bool operator ==(U other) { return *ptr == other; }
310  template<typename U> bool operator !=(U other) { return *ptr != other; }
311  private:
312  T *ptr;
313 };
314 
315 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
316  #define Py_OptimizeFlag 0
317 #endif
318 #define __PYX_BUILD_PY_SSIZE_T "n"
319 #define CYTHON_FORMAT_SSIZE_T "z"
320 #if PY_MAJOR_VERSION < 3
321  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
322  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
323  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
324  #define __Pyx_DefaultClassType PyClass_Type
325 #else
326  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
327 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
328  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
329  PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
330 #else
331  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
332  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
333 #endif
334  #define __Pyx_DefaultClassType PyType_Type
335 #endif
336 #ifndef Py_TPFLAGS_CHECKTYPES
337  #define Py_TPFLAGS_CHECKTYPES 0
338 #endif
339 #ifndef Py_TPFLAGS_HAVE_INDEX
340  #define Py_TPFLAGS_HAVE_INDEX 0
341 #endif
342 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
343  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
344 #endif
345 #ifndef Py_TPFLAGS_HAVE_FINALIZE
346  #define Py_TPFLAGS_HAVE_FINALIZE 0
347 #endif
348 #ifndef METH_STACKLESS
349  #define METH_STACKLESS 0
350 #endif
351 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
352  #ifndef METH_FASTCALL
353  #define METH_FASTCALL 0x80
354  #endif
355  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
356  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
357  Py_ssize_t nargs, PyObject *kwnames);
358 #else
359  #define __Pyx_PyCFunctionFast _PyCFunctionFast
360  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
361 #endif
362 #if CYTHON_FAST_PYCCALL
363 #define __Pyx_PyFastCFunction_Check(func)\
364  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
365 #else
366 #define __Pyx_PyFastCFunction_Check(func) 0
367 #endif
368 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
369  #define PyObject_Malloc(s) PyMem_Malloc(s)
370  #define PyObject_Free(p) PyMem_Free(p)
371  #define PyObject_Realloc(p) PyMem_Realloc(p)
372 #endif
373 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
374  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
375  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
376  #define PyMem_RawFree(p) PyMem_Free(p)
377 #endif
378 #if CYTHON_COMPILING_IN_PYSTON
379  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
380  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
381 #else
382  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
383  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
384 #endif
385 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
386  #define __Pyx_PyThreadState_Current PyThreadState_GET()
387 #elif PY_VERSION_HEX >= 0x03060000
388  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
389 #elif PY_VERSION_HEX >= 0x03000000
390  #define __Pyx_PyThreadState_Current PyThreadState_GET()
391 #else
392  #define __Pyx_PyThreadState_Current _PyThreadState_Current
393 #endif
394 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
395 #include "pythread.h"
396 #define Py_tss_NEEDS_INIT 0
397 typedef int Py_tss_t;
398 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
399  *key = PyThread_create_key();
400  return 0;
401 }
402 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
403  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
404  *key = Py_tss_NEEDS_INIT;
405  return key;
406 }
407 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
408  PyObject_Free(key);
409 }
410 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
411  return *key != Py_tss_NEEDS_INIT;
412 }
413 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
414  PyThread_delete_key(*key);
415  *key = Py_tss_NEEDS_INIT;
416 }
417 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
418  return PyThread_set_key_value(*key, value);
419 }
420 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
421  return PyThread_get_key_value(*key);
422 }
423 #endif
424 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
425 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
426 #else
427 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
428 #endif
429 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
430  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
431  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
432 #else
433  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
434  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
435 #endif
436 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
437 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
438 #else
439 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
440 #endif
441 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
442  #define CYTHON_PEP393_ENABLED 1
443  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
444  0 : _PyUnicode_Ready((PyObject *)(op)))
445  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
446  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
447  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
448  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
449  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
450  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
451  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
452  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
453  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
454  #else
455  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
456  #endif
457 #else
458  #define CYTHON_PEP393_ENABLED 0
459  #define PyUnicode_1BYTE_KIND 1
460  #define PyUnicode_2BYTE_KIND 2
461  #define PyUnicode_4BYTE_KIND 4
462  #define __Pyx_PyUnicode_READY(op) (0)
463  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
464  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
465  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
466  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
467  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
468  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
469  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
470  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
471 #endif
472 #if CYTHON_COMPILING_IN_PYPY
473  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
474  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
475 #else
476  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
477  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
478  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
479 #endif
480 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
481  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
482 #endif
483 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
484  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
485 #endif
486 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
487  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
488 #endif
489 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
490 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
491 #if PY_MAJOR_VERSION >= 3
492  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
493 #else
494  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
495 #endif
496 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
497  #define PyObject_ASCII(o) PyObject_Repr(o)
498 #endif
499 #if PY_MAJOR_VERSION >= 3
500  #define PyBaseString_Type PyUnicode_Type
501  #define PyStringObject PyUnicodeObject
502  #define PyString_Type PyUnicode_Type
503  #define PyString_Check PyUnicode_Check
504  #define PyString_CheckExact PyUnicode_CheckExact
505 #ifndef PyObject_Unicode
506  #define PyObject_Unicode PyObject_Str
507 #endif
508 #endif
509 #if PY_MAJOR_VERSION >= 3
510  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
511  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
512 #else
513  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
514  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
515 #endif
516 #ifndef PySet_CheckExact
517  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
518 #endif
519 #if PY_VERSION_HEX >= 0x030900A4
520  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
521  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
522 #else
523  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
524  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
525 #endif
526 #if CYTHON_ASSUME_SAFE_MACROS
527  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
528 #else
529  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
530 #endif
531 #if PY_MAJOR_VERSION >= 3
532  #define PyIntObject PyLongObject
533  #define PyInt_Type PyLong_Type
534  #define PyInt_Check(op) PyLong_Check(op)
535  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
536  #define PyInt_FromString PyLong_FromString
537  #define PyInt_FromUnicode PyLong_FromUnicode
538  #define PyInt_FromLong PyLong_FromLong
539  #define PyInt_FromSize_t PyLong_FromSize_t
540  #define PyInt_FromSsize_t PyLong_FromSsize_t
541  #define PyInt_AsLong PyLong_AsLong
542  #define PyInt_AS_LONG PyLong_AS_LONG
543  #define PyInt_AsSsize_t PyLong_AsSsize_t
544  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
545  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
546  #define PyNumber_Int PyNumber_Long
547 #endif
548 #if PY_MAJOR_VERSION >= 3
549  #define PyBoolObject PyLongObject
550 #endif
551 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
552  #ifndef PyUnicode_InternFromString
553  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
554  #endif
555 #endif
556 #if PY_VERSION_HEX < 0x030200A4
557  typedef long Py_hash_t;
558  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
559  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
560 #else
561  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
562  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
563 #endif
564 #if PY_MAJOR_VERSION >= 3
565  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
566 #else
567  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
568 #endif
569 #if CYTHON_USE_ASYNC_SLOTS
570  #if PY_VERSION_HEX >= 0x030500B1
571  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
572  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
573  #else
574  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
575  #endif
576 #else
577  #define __Pyx_PyType_AsAsync(obj) NULL
578 #endif
579 #ifndef __Pyx_PyAsyncMethodsStruct
580  typedef struct {
581  unaryfunc am_await;
582  unaryfunc am_aiter;
583  unaryfunc am_anext;
584  } __Pyx_PyAsyncMethodsStruct;
585 #endif
586 
587 #if defined(WIN32) || defined(MS_WINDOWS)
588  #define _USE_MATH_DEFINES
589 #endif
590 #include <math.h>
591 #ifdef NAN
592 #define __PYX_NAN() ((float) NAN)
593 #else
594 static CYTHON_INLINE float __PYX_NAN() {
595  float value;
596  memset(&value, 0xFF, sizeof(value));
597  return value;
598 }
599 #endif
600 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
601 #define __Pyx_truncl trunc
602 #else
603 #define __Pyx_truncl truncl
604 #endif
605 
606 #define __PYX_MARK_ERR_POS(f_index, lineno) \
607  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
608 #define __PYX_ERR(f_index, lineno, Ln_error) \
609  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
610 
611 #ifndef __PYX_EXTERN_C
612  #ifdef __cplusplus
613  #define __PYX_EXTERN_C extern "C"
614  #else
615  #define __PYX_EXTERN_C extern
616  #endif
617 #endif
618 
619 #define __PYX_HAVE__cpartitioning
620 #define __PYX_HAVE_API__cpartitioning
621 /* Early includes */
622 #include <string.h>
623 #include <stdio.h>
624 #include "numpy/arrayobject.h"
625 #include "numpy/ufuncobject.h"
626 
627  /* NumPy API declarations from "numpy/__init__.pxd" */
628 
629 #include "mpi.h"
630 #include "mesh.h"
631 #include "partitioning.h"
632 #include "pythread.h"
633 #include <stdlib.h>
634 #include "pystate.h"
635 #ifdef _OPENMP
636 #include <omp.h>
637 #endif /* _OPENMP */
638 
639 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
640 #define CYTHON_WITHOUT_ASSERTIONS
641 #endif
642 
643 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
644  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
645 
646 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
647 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
648 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
649 #define __PYX_DEFAULT_STRING_ENCODING ""
650 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
651 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
652 #define __Pyx_uchar_cast(c) ((unsigned char)c)
653 #define __Pyx_long_cast(x) ((long)x)
654 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
655  (sizeof(type) < sizeof(Py_ssize_t)) ||\
656  (sizeof(type) > sizeof(Py_ssize_t) &&\
657  likely(v < (type)PY_SSIZE_T_MAX ||\
658  v == (type)PY_SSIZE_T_MAX) &&\
659  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
660  v == (type)PY_SSIZE_T_MIN))) ||\
661  (sizeof(type) == sizeof(Py_ssize_t) &&\
662  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
663  v == (type)PY_SSIZE_T_MAX))) )
664 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
665  return (size_t) i < (size_t) limit;
666 }
667 #if defined (__cplusplus) && __cplusplus >= 201103L
668  #include <cstdlib>
669  #define __Pyx_sst_abs(value) std::abs(value)
670 #elif SIZEOF_INT >= SIZEOF_SIZE_T
671  #define __Pyx_sst_abs(value) abs(value)
672 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
673  #define __Pyx_sst_abs(value) labs(value)
674 #elif defined (_MSC_VER)
675  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
676 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
677  #define __Pyx_sst_abs(value) llabs(value)
678 #elif defined (__GNUC__)
679  #define __Pyx_sst_abs(value) __builtin_llabs(value)
680 #else
681  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
682 #endif
683 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
684 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
685 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
686 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
687 #define __Pyx_PyBytes_FromString PyBytes_FromString
688 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
689 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
690 #if PY_MAJOR_VERSION < 3
691  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
692  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
693 #else
694  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
695  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
696 #endif
697 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
698 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
699 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
700 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
701 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
702 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
703 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
704 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
705 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
706 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
707 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
708 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
709 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
710 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
711 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
712 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
713 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
714  const Py_UNICODE *u_end = u;
715  while (*u_end++) ;
716  return (size_t)(u_end - u - 1);
717 }
718 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
719 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
720 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
721 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
722 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
723 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
724 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
725 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
726 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
727 #define __Pyx_PySequence_Tuple(obj)\
728  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
729 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
730 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
731 #if CYTHON_ASSUME_SAFE_MACROS
732 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
733 #else
734 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
735 #endif
736 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
737 #if PY_MAJOR_VERSION >= 3
738 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
739 #else
740 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
741 #endif
742 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
743 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
744 static int __Pyx_sys_getdefaultencoding_not_ascii;
745 static int __Pyx_init_sys_getdefaultencoding_params(void) {
746  PyObject* sys;
747  PyObject* default_encoding = NULL;
748  PyObject* ascii_chars_u = NULL;
749  PyObject* ascii_chars_b = NULL;
750  const char* default_encoding_c;
751  sys = PyImport_ImportModule("sys");
752  if (!sys) goto bad;
753  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
754  Py_DECREF(sys);
755  if (!default_encoding) goto bad;
756  default_encoding_c = PyBytes_AsString(default_encoding);
757  if (!default_encoding_c) goto bad;
758  if (strcmp(default_encoding_c, "ascii") == 0) {
759  __Pyx_sys_getdefaultencoding_not_ascii = 0;
760  } else {
761  char ascii_chars[128];
762  int c;
763  for (c = 0; c < 128; c++) {
764  ascii_chars[c] = c;
765  }
766  __Pyx_sys_getdefaultencoding_not_ascii = 1;
767  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
768  if (!ascii_chars_u) goto bad;
769  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
770  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
771  PyErr_Format(
772  PyExc_ValueError,
773  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
774  default_encoding_c);
775  goto bad;
776  }
777  Py_DECREF(ascii_chars_u);
778  Py_DECREF(ascii_chars_b);
779  }
780  Py_DECREF(default_encoding);
781  return 0;
782 bad:
783  Py_XDECREF(default_encoding);
784  Py_XDECREF(ascii_chars_u);
785  Py_XDECREF(ascii_chars_b);
786  return -1;
787 }
788 #endif
789 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
790 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
791 #else
792 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
793 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
794 static char* __PYX_DEFAULT_STRING_ENCODING;
795 static int __Pyx_init_sys_getdefaultencoding_params(void) {
796  PyObject* sys;
797  PyObject* default_encoding = NULL;
798  char* default_encoding_c;
799  sys = PyImport_ImportModule("sys");
800  if (!sys) goto bad;
801  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
802  Py_DECREF(sys);
803  if (!default_encoding) goto bad;
804  default_encoding_c = PyBytes_AsString(default_encoding);
805  if (!default_encoding_c) goto bad;
806  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
807  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
808  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
809  Py_DECREF(default_encoding);
810  return 0;
811 bad:
812  Py_XDECREF(default_encoding);
813  return -1;
814 }
815 #endif
816 #endif
817 
818 
819 /* Test for GCC > 2.95 */
820 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
821  #define likely(x) __builtin_expect(!!(x), 1)
822  #define unlikely(x) __builtin_expect(!!(x), 0)
823 #else /* !__GNUC__ or GCC < 2.95 */
824  #define likely(x) (x)
825  #define unlikely(x) (x)
826 #endif /* __GNUC__ */
827 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
828 
829 static PyObject *__pyx_m = NULL;
830 static PyObject *__pyx_d;
831 static PyObject *__pyx_b;
832 static PyObject *__pyx_cython_runtime = NULL;
833 static PyObject *__pyx_empty_tuple;
834 static PyObject *__pyx_empty_bytes;
835 static PyObject *__pyx_empty_unicode;
836 static int __pyx_lineno;
837 static int __pyx_clineno = 0;
838 static const char * __pyx_cfilenm= __FILE__;
839 static const char *__pyx_filename;
840 
841 /* Header.proto */
842 #if !defined(CYTHON_CCOMPLEX)
843  #if defined(__cplusplus)
844  #define CYTHON_CCOMPLEX 1
845  #elif defined(_Complex_I)
846  #define CYTHON_CCOMPLEX 1
847  #else
848  #define CYTHON_CCOMPLEX 0
849  #endif
850 #endif
851 #if CYTHON_CCOMPLEX
852  #ifdef __cplusplus
853  #include <complex>
854  #else
855  #include <complex.h>
856  #endif
857 #endif
858 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
859  #undef _Complex_I
860  #define _Complex_I 1.0fj
861 #endif
862 
863 
864 static const char *__pyx_f[] = {
865  "proteus/cpartitioning.pyx",
866  "__init__.pxd",
867  "stringsource",
868  "type.pxd",
869  "MPI.pxd",
870  "proteus/cmeshTools.pxd",
871 };
872 /* ForceInitThreads.proto */
873 #ifndef __PYX_FORCE_INIT_THREADS
874  #define __PYX_FORCE_INIT_THREADS 0
875 #endif
876 
877 /* NoFastGil.proto */
878 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
879 #define __Pyx_PyGILState_Release PyGILState_Release
880 #define __Pyx_FastGIL_Remember()
881 #define __Pyx_FastGIL_Forget()
882 #define __Pyx_FastGilFuncInit()
883 
884 /* BufferFormatStructs.proto */
885 #define IS_UNSIGNED(type) (((type) -1) > 0)
886 struct __Pyx_StructField_;
887 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
888 typedef struct {
889  const char* name;
890  struct __Pyx_StructField_* fields;
891  size_t size;
892  size_t arraysize[8];
893  int ndim;
894  char typegroup;
895  char is_unsigned;
896  int flags;
897 } __Pyx_TypeInfo;
898 typedef struct __Pyx_StructField_ {
899  __Pyx_TypeInfo* type;
900  const char* name;
901  size_t offset;
902 } __Pyx_StructField;
903 typedef struct {
904  __Pyx_StructField* field;
905  size_t parent_offset;
906 } __Pyx_BufFmt_StackElem;
907 typedef struct {
908  __Pyx_StructField root;
909  __Pyx_BufFmt_StackElem* head;
910  size_t fmt_offset;
911  size_t new_count, enc_count;
912  size_t struct_alignment;
913  int is_complex;
914  char enc_type;
915  char new_packmode;
916  char enc_packmode;
917  char is_valid_array;
918 } __Pyx_BufFmt_Context;
919 
920 /* Atomics.proto */
921 #include <pythread.h>
922 #ifndef CYTHON_ATOMICS
923  #define CYTHON_ATOMICS 1
924 #endif
925 #define __pyx_atomic_int_type int
926 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
927  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
928  !defined(__i386__)
929  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
930  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
931  #ifdef __PYX_DEBUG_ATOMICS
932  #warning "Using GNU atomics"
933  #endif
934 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
935  #include <Windows.h>
936  #undef __pyx_atomic_int_type
937  #define __pyx_atomic_int_type LONG
938  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
939  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
940  #ifdef __PYX_DEBUG_ATOMICS
941  #pragma message ("Using MSVC atomics")
942  #endif
943 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
944  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
945  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
946  #ifdef __PYX_DEBUG_ATOMICS
947  #warning "Using Intel atomics"
948  #endif
949 #else
950  #undef CYTHON_ATOMICS
951  #define CYTHON_ATOMICS 0
952  #ifdef __PYX_DEBUG_ATOMICS
953  #warning "Not using atomics"
954  #endif
955 #endif
956 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
957 #if CYTHON_ATOMICS
958  #define __pyx_add_acquisition_count(memview)\
959  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
960  #define __pyx_sub_acquisition_count(memview)\
961  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
962 #else
963  #define __pyx_add_acquisition_count(memview)\
964  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
965  #define __pyx_sub_acquisition_count(memview)\
966  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
967 #endif
968 
969 /* MemviewSliceStruct.proto */
970 struct __pyx_memoryview_obj;
971 typedef struct {
972  struct __pyx_memoryview_obj *memview;
973  char *data;
974  Py_ssize_t shape[8];
975  Py_ssize_t strides[8];
976  Py_ssize_t suboffsets[8];
977 } __Pyx_memviewslice;
978 #define __Pyx_MemoryView_Len(m) (m.shape[0])
979 
980 
981 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":697
982  * # in Cython to enable them only on the right systems.
983  *
984  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
985  * ctypedef npy_int16 int16_t
986  * ctypedef npy_int32 int32_t
987  */
988 typedef npy_int8 __pyx_t_5numpy_int8_t;
989 
990 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":698
991  *
992  * ctypedef npy_int8 int8_t
993  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
994  * ctypedef npy_int32 int32_t
995  * ctypedef npy_int64 int64_t
996  */
997 typedef npy_int16 __pyx_t_5numpy_int16_t;
998 
999 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":699
1000  * ctypedef npy_int8 int8_t
1001  * ctypedef npy_int16 int16_t
1002  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1003  * ctypedef npy_int64 int64_t
1004  * #ctypedef npy_int96 int96_t
1005  */
1006 typedef npy_int32 __pyx_t_5numpy_int32_t;
1007 
1008 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":700
1009  * ctypedef npy_int16 int16_t
1010  * ctypedef npy_int32 int32_t
1011  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1012  * #ctypedef npy_int96 int96_t
1013  * #ctypedef npy_int128 int128_t
1014  */
1015 typedef npy_int64 __pyx_t_5numpy_int64_t;
1016 
1017 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":704
1018  * #ctypedef npy_int128 int128_t
1019  *
1020  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1021  * ctypedef npy_uint16 uint16_t
1022  * ctypedef npy_uint32 uint32_t
1023  */
1024 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1025 
1026 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":705
1027  *
1028  * ctypedef npy_uint8 uint8_t
1029  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1030  * ctypedef npy_uint32 uint32_t
1031  * ctypedef npy_uint64 uint64_t
1032  */
1033 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1034 
1035 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":706
1036  * ctypedef npy_uint8 uint8_t
1037  * ctypedef npy_uint16 uint16_t
1038  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1039  * ctypedef npy_uint64 uint64_t
1040  * #ctypedef npy_uint96 uint96_t
1041  */
1042 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1043 
1044 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":707
1045  * ctypedef npy_uint16 uint16_t
1046  * ctypedef npy_uint32 uint32_t
1047  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1048  * #ctypedef npy_uint96 uint96_t
1049  * #ctypedef npy_uint128 uint128_t
1050  */
1051 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1052 
1053 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":711
1054  * #ctypedef npy_uint128 uint128_t
1055  *
1056  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1057  * ctypedef npy_float64 float64_t
1058  * #ctypedef npy_float80 float80_t
1059  */
1060 typedef npy_float32 __pyx_t_5numpy_float32_t;
1061 
1062 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":712
1063  *
1064  * ctypedef npy_float32 float32_t
1065  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1066  * #ctypedef npy_float80 float80_t
1067  * #ctypedef npy_float128 float128_t
1068  */
1069 typedef npy_float64 __pyx_t_5numpy_float64_t;
1070 
1071 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":721
1072  * # The int types are mapped a bit surprising --
1073  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1074  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1075  * ctypedef npy_longlong long_t
1076  * ctypedef npy_longlong longlong_t
1077  */
1078 typedef npy_long __pyx_t_5numpy_int_t;
1079 
1080 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":722
1081  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1082  * ctypedef npy_long int_t
1083  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1084  * ctypedef npy_longlong longlong_t
1085  *
1086  */
1087 typedef npy_longlong __pyx_t_5numpy_long_t;
1088 
1089 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":723
1090  * ctypedef npy_long int_t
1091  * ctypedef npy_longlong long_t
1092  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1093  *
1094  * ctypedef npy_ulong uint_t
1095  */
1096 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1097 
1098 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":725
1099  * ctypedef npy_longlong longlong_t
1100  *
1101  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1102  * ctypedef npy_ulonglong ulong_t
1103  * ctypedef npy_ulonglong ulonglong_t
1104  */
1105 typedef npy_ulong __pyx_t_5numpy_uint_t;
1106 
1107 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":726
1108  *
1109  * ctypedef npy_ulong uint_t
1110  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1111  * ctypedef npy_ulonglong ulonglong_t
1112  *
1113  */
1114 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1115 
1116 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":727
1117  * ctypedef npy_ulong uint_t
1118  * ctypedef npy_ulonglong ulong_t
1119  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1120  *
1121  * ctypedef npy_intp intp_t
1122  */
1123 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1124 
1125 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":729
1126  * ctypedef npy_ulonglong ulonglong_t
1127  *
1128  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1129  * ctypedef npy_uintp uintp_t
1130  *
1131  */
1132 typedef npy_intp __pyx_t_5numpy_intp_t;
1133 
1134 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":730
1135  *
1136  * ctypedef npy_intp intp_t
1137  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1138  *
1139  * ctypedef npy_double float_t
1140  */
1141 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1142 
1143 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":732
1144  * ctypedef npy_uintp uintp_t
1145  *
1146  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1147  * ctypedef npy_double double_t
1148  * ctypedef npy_longdouble longdouble_t
1149  */
1150 typedef npy_double __pyx_t_5numpy_float_t;
1151 
1152 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":733
1153  *
1154  * ctypedef npy_double float_t
1155  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1156  * ctypedef npy_longdouble longdouble_t
1157  *
1158  */
1159 typedef npy_double __pyx_t_5numpy_double_t;
1160 
1161 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":734
1162  * ctypedef npy_double float_t
1163  * ctypedef npy_double double_t
1164  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1165  *
1166  * ctypedef npy_cfloat cfloat_t
1167  */
1168 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1169 /* Declarations.proto */
1170 #if CYTHON_CCOMPLEX
1171  #ifdef __cplusplus
1172  typedef ::std::complex< float > __pyx_t_float_complex;
1173  #else
1174  typedef float _Complex __pyx_t_float_complex;
1175  #endif
1176 #else
1177  typedef struct { float real, imag; } __pyx_t_float_complex;
1178 #endif
1179 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1180 
1181 /* Declarations.proto */
1182 #if CYTHON_CCOMPLEX
1183  #ifdef __cplusplus
1184  typedef ::std::complex< double > __pyx_t_double_complex;
1185  #else
1186  typedef double _Complex __pyx_t_double_complex;
1187  #endif
1188 #else
1189  typedef struct { double real, imag; } __pyx_t_double_complex;
1190 #endif
1191 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1192 
1193 
1194 /*--- Type declarations ---*/
1195 struct PyMPIStatusObject;
1196 struct PyMPIDatatypeObject;
1197 struct PyMPIRequestObject;
1198 struct PyMPIPrequestObject;
1199 struct PyMPIGrequestObject;
1200 struct PyMPIMessageObject;
1201 struct PyMPIOpObject;
1202 struct PyMPIGroupObject;
1203 struct PyMPIInfoObject;
1204 struct PyMPIErrhandlerObject;
1205 struct PyMPICommObject;
1206 struct PyMPIIntracommObject;
1207 struct PyMPITopocommObject;
1208 struct PyMPICartcommObject;
1209 struct PyMPIGraphcommObject;
1210 struct PyMPIDistgraphcommObject;
1211 struct PyMPIIntercommObject;
1212 struct PyMPIWinObject;
1213 struct PyMPIFileObject;
1214 struct __pyx_obj_7proteus_10cmeshTools_CMesh;
1215 struct __pyx_array_obj;
1216 struct __pyx_MemviewEnum_obj;
1217 struct __pyx_memoryview_obj;
1218 struct __pyx_memoryviewslice_obj;
1219 
1220 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":736
1221  * ctypedef npy_longdouble longdouble_t
1222  *
1223  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1224  * ctypedef npy_cdouble cdouble_t
1225  * ctypedef npy_clongdouble clongdouble_t
1226  */
1227 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1228 
1229 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":737
1230  *
1231  * ctypedef npy_cfloat cfloat_t
1232  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1233  * ctypedef npy_clongdouble clongdouble_t
1234  *
1235  */
1236 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1237 
1238 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":738
1239  * ctypedef npy_cfloat cfloat_t
1240  * ctypedef npy_cdouble cdouble_t
1241  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1242  *
1243  * ctypedef npy_cdouble complex_t
1244  */
1245 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1246 
1247 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":740
1248  * ctypedef npy_clongdouble clongdouble_t
1249  *
1250  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1251  *
1252  * cdef inline object PyArray_MultiIterNew1(a):
1253  */
1254 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1255 
1256 /* "mpi4py/MPI.pxd":28
1257  * ctypedef MPI_Count Count "MPI_Count"
1258  *
1259  * ctypedef public api class Status [ # <<<<<<<<<<<<<<
1260  * type PyMPIStatus_Type,
1261  * object PyMPIStatusObject,
1262  */
1263 struct PyMPIStatusObject {
1264  PyObject_HEAD
1265  MPI_Status ob_mpi;
1266  unsigned int flags;
1267 };
1268 typedef struct PyMPIStatusObject PyMPIStatusObject;
1269 
1270 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIStatus_Type;
1271 
1272 /* "mpi4py/MPI.pxd":35
1273  * cdef unsigned flags
1274  *
1275  * ctypedef public api class Datatype [ # <<<<<<<<<<<<<<
1276  * type PyMPIDatatype_Type,
1277  * object PyMPIDatatypeObject,
1278  */
1279 struct PyMPIDatatypeObject {
1280  PyObject_HEAD
1281  MPI_Datatype ob_mpi;
1282  unsigned int flags;
1283 };
1284 typedef struct PyMPIDatatypeObject PyMPIDatatypeObject;
1285 
1286 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDatatype_Type;
1287 
1288 /* "mpi4py/MPI.pxd":42
1289  * cdef unsigned flags
1290  *
1291  * ctypedef public api class Request [ # <<<<<<<<<<<<<<
1292  * type PyMPIRequest_Type,
1293  * object PyMPIRequestObject,
1294  */
1295 struct PyMPIRequestObject {
1296  PyObject_HEAD
1297  MPI_Request ob_mpi;
1298  unsigned int flags;
1299  PyObject *ob_buf;
1300 };
1301 typedef struct PyMPIRequestObject PyMPIRequestObject;
1302 
1303 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIRequest_Type;
1304 
1305 /* "mpi4py/MPI.pxd":50
1306  * cdef object ob_buf
1307  *
1308  * ctypedef public api class Prequest(Request) [ # <<<<<<<<<<<<<<
1309  * type PyMPIPrequest_Type,
1310  * object PyMPIPrequestObject,
1311  */
1312 struct PyMPIPrequestObject {
1313  struct PyMPIRequestObject __pyx_base;
1314 };
1315 typedef struct PyMPIPrequestObject PyMPIPrequestObject;
1316 
1317 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIPrequest_Type;
1318 
1319 /* "mpi4py/MPI.pxd":56
1320  * pass
1321  *
1322  * ctypedef public api class Grequest(Request) [ # <<<<<<<<<<<<<<
1323  * type PyMPIGrequest_Type,
1324  * object PyMPIGrequestObject,
1325  */
1326 struct PyMPIGrequestObject {
1327  struct PyMPIRequestObject __pyx_base;
1328  MPI_Request ob_grequest;
1329 };
1330 typedef struct PyMPIGrequestObject PyMPIGrequestObject;
1331 
1332 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGrequest_Type;
1333 
1334 /* "mpi4py/MPI.pxd":62
1335  * cdef MPI_Request ob_grequest
1336  *
1337  * ctypedef public api class Message [ # <<<<<<<<<<<<<<
1338  * type PyMPIMessage_Type,
1339  * object PyMPIMessageObject,
1340  */
1341 struct PyMPIMessageObject {
1342  PyObject_HEAD
1343  MPI_Message ob_mpi;
1344  unsigned int flags;
1345  PyObject *ob_buf;
1346 };
1347 typedef struct PyMPIMessageObject PyMPIMessageObject;
1348 
1349 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIMessage_Type;
1350 
1351 /* "mpi4py/MPI.pxd":70
1352  * cdef object ob_buf
1353  *
1354  * ctypedef public api class Op [ # <<<<<<<<<<<<<<
1355  * type PyMPIOp_Type,
1356  * object PyMPIOpObject,
1357  */
1358 struct PyMPIOpObject {
1359  PyObject_HEAD
1360  MPI_Op ob_mpi;
1361  unsigned int flags;
1362  PyObject *(*ob_func)(PyObject *, PyObject *);
1363  int ob_usrid;
1364 };
1365 typedef struct PyMPIOpObject PyMPIOpObject;
1366 
1367 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIOp_Type;
1368 
1369 /* "mpi4py/MPI.pxd":79
1370  * cdef int ob_usrid
1371  *
1372  * ctypedef public api class Group [ # <<<<<<<<<<<<<<
1373  * type PyMPIGroup_Type,
1374  * object PyMPIGroupObject,
1375  */
1376 struct PyMPIGroupObject {
1377  PyObject_HEAD
1378  MPI_Group ob_mpi;
1379  unsigned int flags;
1380 };
1381 typedef struct PyMPIGroupObject PyMPIGroupObject;
1382 
1383 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGroup_Type;
1384 
1385 /* "mpi4py/MPI.pxd":86
1386  * cdef unsigned flags
1387  *
1388  * ctypedef public api class Info [ # <<<<<<<<<<<<<<
1389  * type PyMPIInfo_Type,
1390  * object PyMPIInfoObject,
1391  */
1392 struct PyMPIInfoObject {
1393  PyObject_HEAD
1394  MPI_Info ob_mpi;
1395  unsigned int flags;
1396 };
1397 typedef struct PyMPIInfoObject PyMPIInfoObject;
1398 
1399 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIInfo_Type;
1400 
1401 /* "mpi4py/MPI.pxd":93
1402  * cdef unsigned flags
1403  *
1404  * ctypedef public api class Errhandler [ # <<<<<<<<<<<<<<
1405  * type PyMPIErrhandler_Type,
1406  * object PyMPIErrhandlerObject,
1407  */
1408 struct PyMPIErrhandlerObject {
1409  PyObject_HEAD
1410  MPI_Errhandler ob_mpi;
1411  unsigned int flags;
1412 };
1413 typedef struct PyMPIErrhandlerObject PyMPIErrhandlerObject;
1414 
1415 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIErrhandler_Type;
1416 
1417 /* "mpi4py/MPI.pxd":100
1418  * cdef unsigned flags
1419  *
1420  * ctypedef public api class Comm [ # <<<<<<<<<<<<<<
1421  * type PyMPIComm_Type,
1422  * object PyMPICommObject,
1423  */
1424 struct PyMPICommObject {
1425  PyObject_HEAD
1426  MPI_Comm ob_mpi;
1427  unsigned int flags;
1428 };
1429 typedef struct PyMPICommObject PyMPICommObject;
1430 
1431 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIComm_Type;
1432 
1433 /* "mpi4py/MPI.pxd":107
1434  * cdef unsigned flags
1435  *
1436  * ctypedef public api class Intracomm(Comm) [ # <<<<<<<<<<<<<<
1437  * type PyMPIIntracomm_Type,
1438  * object PyMPIIntracommObject,
1439  */
1440 struct PyMPIIntracommObject {
1441  struct PyMPICommObject __pyx_base;
1442 };
1443 typedef struct PyMPIIntracommObject PyMPIIntracommObject;
1444 
1445 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntracomm_Type;
1446 
1447 /* "mpi4py/MPI.pxd":113
1448  * pass
1449  *
1450  * ctypedef public api class Topocomm(Intracomm) [ # <<<<<<<<<<<<<<
1451  * type PyMPITopocomm_Type,
1452  * object PyMPITopocommObject,
1453  */
1454 struct PyMPITopocommObject {
1455  struct PyMPIIntracommObject __pyx_base;
1456 };
1457 typedef struct PyMPITopocommObject PyMPITopocommObject;
1458 
1459 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPITopocomm_Type;
1460 
1461 /* "mpi4py/MPI.pxd":119
1462  * pass
1463  *
1464  * ctypedef public api class Cartcomm(Topocomm) [ # <<<<<<<<<<<<<<
1465  * type PyMPICartcomm_Type,
1466  * object PyMPICartcommObject,
1467  */
1468 struct PyMPICartcommObject {
1469  struct PyMPITopocommObject __pyx_base;
1470 };
1471 typedef struct PyMPICartcommObject PyMPICartcommObject;
1472 
1473 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPICartcomm_Type;
1474 
1475 /* "mpi4py/MPI.pxd":125
1476  * pass
1477  *
1478  * ctypedef public api class Graphcomm(Topocomm) [ # <<<<<<<<<<<<<<
1479  * type PyMPIGraphcomm_Type,
1480  * object PyMPIGraphcommObject,
1481  */
1482 struct PyMPIGraphcommObject {
1483  struct PyMPITopocommObject __pyx_base;
1484 };
1485 typedef struct PyMPIGraphcommObject PyMPIGraphcommObject;
1486 
1487 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGraphcomm_Type;
1488 
1489 /* "mpi4py/MPI.pxd":131
1490  * pass
1491  *
1492  * ctypedef public api class Distgraphcomm(Topocomm) [ # <<<<<<<<<<<<<<
1493  * type PyMPIDistgraphcomm_Type,
1494  * object PyMPIDistgraphcommObject,
1495  */
1496 struct PyMPIDistgraphcommObject {
1497  struct PyMPITopocommObject __pyx_base;
1498 };
1499 typedef struct PyMPIDistgraphcommObject PyMPIDistgraphcommObject;
1500 
1501 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDistgraphcomm_Type;
1502 
1503 /* "mpi4py/MPI.pxd":137
1504  * pass
1505  *
1506  * ctypedef public api class Intercomm(Comm) [ # <<<<<<<<<<<<<<
1507  * type PyMPIIntercomm_Type,
1508  * object PyMPIIntercommObject,
1509  */
1510 struct PyMPIIntercommObject {
1511  struct PyMPICommObject __pyx_base;
1512 };
1513 typedef struct PyMPIIntercommObject PyMPIIntercommObject;
1514 
1515 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntercomm_Type;
1516 
1517 /* "mpi4py/MPI.pxd":143
1518  * pass
1519  *
1520  * ctypedef public api class Win [ # <<<<<<<<<<<<<<
1521  * type PyMPIWin_Type,
1522  * object PyMPIWinObject,
1523  */
1524 struct PyMPIWinObject {
1525  PyObject_HEAD
1526  MPI_Win ob_mpi;
1527  unsigned int flags;
1528  PyObject *ob_mem;
1529 };
1530 typedef struct PyMPIWinObject PyMPIWinObject;
1531 
1532 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIWin_Type;
1533 
1534 /* "mpi4py/MPI.pxd":151
1535  * cdef object ob_mem
1536  *
1537  * ctypedef public api class File [ # <<<<<<<<<<<<<<
1538  * type PyMPIFile_Type,
1539  * object PyMPIFileObject,
1540  */
1541 struct PyMPIFileObject {
1542  PyObject_HEAD
1543  MPI_File ob_mpi;
1544  unsigned int flags;
1545 };
1546 typedef struct PyMPIFileObject PyMPIFileObject;
1547 
1548 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIFile_Type;
1549 
1550 /* "cmeshTools.pxd":5
1551  * cimport mesh as cppm
1552  *
1553  * cdef class CMesh: # <<<<<<<<<<<<<<
1554  * cdef cppm.Mesh mesh
1555  * cdef public:
1556  */
1557 struct __pyx_obj_7proteus_10cmeshTools_CMesh {
1558  PyObject_HEAD
1559  struct Mesh mesh;
1560  int nElements_global;
1561  int nNodes_global;
1562  int nNodes_element;
1568  int max_nElements_node;
1569  int nEdges_global;
1571  PyArrayObject *elementNodesArray;
1572  PyArrayObject *nodeElementsArray;
1573  PyArrayObject *nodeElementOffsets;
1574  PyArrayObject *elementNeighborsArray;
1575  PyArrayObject *elementBoundariesArray;
1576  PyArrayObject *elementBoundaryNodesArray;
1577  PyArrayObject *elementBoundaryElementsArray;
1579  PyArrayObject *interiorElementBoundariesArray;
1580  PyArrayObject *exteriorElementBoundariesArray;
1581  PyArrayObject *edgeNodesArray;
1582  PyArrayObject *nodeStarArray;
1583  PyArrayObject *nodeStarOffsets;
1584  PyArrayObject *elementMaterialTypes;
1585  PyArrayObject *elementBoundaryMaterialTypes;
1586  PyArrayObject *nodeMaterialTypes;
1587  PyArrayObject *nodeArray;
1588  int nx;
1589  int ny;
1590  int nz;
1591  int px;
1592  int py;
1593  int pz;
1594  PyArrayObject *elementIJK;
1595  PyArrayObject *weights;
1596  PyArrayObject *U_KNOT;
1597  PyArrayObject *V_KNOT;
1598  PyArrayObject *W_KNOT;
1599  PyArrayObject *elementDiametersArray;
1600  PyArrayObject *elementInnerDiametersArray;
1601  PyArrayObject *elementBoundaryDiametersArray;
1602  PyArrayObject *elementBarycentersArray;
1603  PyArrayObject *elementBoundaryBarycentersArray;
1604  PyArrayObject *nodeDiametersArray;
1605  PyArrayObject *nodeSupportArray;
1606  double h;
1607  double hMin;
1608  double sigmaMax;
1609  double volume;
1610 };
1611 
1612 
1613 /* "View.MemoryView":105
1614  *
1615  * @cname("__pyx_array")
1616  * cdef class array: # <<<<<<<<<<<<<<
1617  *
1618  * cdef:
1619  */
1620 struct __pyx_array_obj {
1621  PyObject_HEAD
1622  struct __pyx_vtabstruct_array *__pyx_vtab;
1623  char *data;
1624  Py_ssize_t len;
1625  char *format;
1626  int ndim;
1627  Py_ssize_t *_shape;
1628  Py_ssize_t *_strides;
1629  Py_ssize_t itemsize;
1630  PyObject *mode;
1631  PyObject *_format;
1632  void (*callback_free_data)(void *);
1633  int free_data;
1634  int dtype_is_object;
1635 };
1636 
1637 
1638 /* "View.MemoryView":279
1639  *
1640  * @cname('__pyx_MemviewEnum')
1641  * cdef class Enum(object): # <<<<<<<<<<<<<<
1642  * cdef object name
1643  * def __init__(self, name):
1644  */
1645 struct __pyx_MemviewEnum_obj {
1646  PyObject_HEAD
1647  PyObject *name;
1648 };
1649 
1650 
1651 /* "View.MemoryView":330
1652  *
1653  * @cname('__pyx_memoryview')
1654  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1655  *
1656  * cdef object obj
1657  */
1658 struct __pyx_memoryview_obj {
1659  PyObject_HEAD
1660  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1661  PyObject *obj;
1662  PyObject *_size;
1663  PyObject *_array_interface;
1664  PyThread_type_lock lock;
1665  __pyx_atomic_int acquisition_count[2];
1666  __pyx_atomic_int *acquisition_count_aligned_p;
1667  Py_buffer view;
1668  int flags;
1669  int dtype_is_object;
1670  __Pyx_TypeInfo *typeinfo;
1671 };
1672 
1673 
1674 /* "View.MemoryView":965
1675  *
1676  * @cname('__pyx_memoryviewslice')
1677  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1678  * "Internal class for passing memoryview slices to Python"
1679  *
1680  */
1681 struct __pyx_memoryviewslice_obj {
1682  struct __pyx_memoryview_obj __pyx_base;
1683  __Pyx_memviewslice from_slice;
1684  PyObject *from_object;
1685  PyObject *(*to_object_func)(char *);
1686  int (*to_dtype_func)(char *, PyObject *);
1687 };
1688 
1689 
1690 
1691 /* "View.MemoryView":105
1692  *
1693  * @cname("__pyx_array")
1694  * cdef class array: # <<<<<<<<<<<<<<
1695  *
1696  * cdef:
1697  */
1698 
1699 struct __pyx_vtabstruct_array {
1700  PyObject *(*get_memview)(struct __pyx_array_obj *);
1701 };
1702 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1703 
1704 
1705 /* "View.MemoryView":330
1706  *
1707  * @cname('__pyx_memoryview')
1708  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1709  *
1710  * cdef object obj
1711  */
1712 
1713 struct __pyx_vtabstruct_memoryview {
1714  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1715  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1716  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1717  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1718  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1719  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1720  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1721 };
1722 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1723 
1724 
1725 /* "View.MemoryView":965
1726  *
1727  * @cname('__pyx_memoryviewslice')
1728  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1729  * "Internal class for passing memoryview slices to Python"
1730  *
1731  */
1732 
1733 struct __pyx_vtabstruct__memoryviewslice {
1734  struct __pyx_vtabstruct_memoryview __pyx_base;
1735 };
1736 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1737 
1738 /* --- Runtime support code (head) --- */
1739 /* Refnanny.proto */
1740 #ifndef CYTHON_REFNANNY
1741  #define CYTHON_REFNANNY 0
1742 #endif
1743 #if CYTHON_REFNANNY
1744  typedef struct {
1745  void (*INCREF)(void*, PyObject*, int);
1746  void (*DECREF)(void*, PyObject*, int);
1747  void (*GOTREF)(void*, PyObject*, int);
1748  void (*GIVEREF)(void*, PyObject*, int);
1749  void* (*SetupContext)(const char*, int, const char*);
1750  void (*FinishContext)(void**);
1751  } __Pyx_RefNannyAPIStruct;
1752  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1753  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1754  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1755 #ifdef WITH_THREAD
1756  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1757  if (acquire_gil) {\
1758  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1759  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1760  PyGILState_Release(__pyx_gilstate_save);\
1761  } else {\
1762  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1763  }
1764 #else
1765  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1766  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1767 #endif
1768  #define __Pyx_RefNannyFinishContext()\
1769  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1770  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1771  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1772  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1773  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1774  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1775  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1776  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1777  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1778 #else
1779  #define __Pyx_RefNannyDeclarations
1780  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1781  #define __Pyx_RefNannyFinishContext()
1782  #define __Pyx_INCREF(r) Py_INCREF(r)
1783  #define __Pyx_DECREF(r) Py_DECREF(r)
1784  #define __Pyx_GOTREF(r)
1785  #define __Pyx_GIVEREF(r)
1786  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1787  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1788  #define __Pyx_XGOTREF(r)
1789  #define __Pyx_XGIVEREF(r)
1790 #endif
1791 #define __Pyx_XDECREF_SET(r, v) do {\
1792  PyObject *tmp = (PyObject *) r;\
1793  r = v; __Pyx_XDECREF(tmp);\
1794  } while (0)
1795 #define __Pyx_DECREF_SET(r, v) do {\
1796  PyObject *tmp = (PyObject *) r;\
1797  r = v; __Pyx_DECREF(tmp);\
1798  } while (0)
1799 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1800 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1801 
1802 /* RaiseArgTupleInvalid.proto */
1803 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1804  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1805 
1806 /* RaiseDoubleKeywords.proto */
1807 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1808 
1809 /* ParseKeywords.proto */
1810 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1811  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1812  const char* function_name);
1813 
1814 /* ArgTypeTest.proto */
1815 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1816  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1817  __Pyx__ArgTypeTest(obj, type, name, exact))
1818 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1819 
1820 /* PyObjectGetAttrStr.proto */
1821 #if CYTHON_USE_TYPE_SLOTS
1822 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1823 #else
1824 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1825 #endif
1826 
1827 /* GetBuiltinName.proto */
1828 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1829 
1830 /* PyDictVersioning.proto */
1831 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1832 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1833 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1834 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1835  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1836  (cache_var) = (value);
1837 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1838  static PY_UINT64_T __pyx_dict_version = 0;\
1839  static PyObject *__pyx_dict_cached_value = NULL;\
1840  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1841  (VAR) = __pyx_dict_cached_value;\
1842  } else {\
1843  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1844  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1845  }\
1846 }
1847 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1848 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1849 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1850 #else
1851 #define __PYX_GET_DICT_VERSION(dict) (0)
1852 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1853 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1854 #endif
1855 
1856 /* GetModuleGlobalName.proto */
1857 #if CYTHON_USE_DICT_VERSIONS
1858 #define __Pyx_GetModuleGlobalName(var, name) {\
1859  static PY_UINT64_T __pyx_dict_version = 0;\
1860  static PyObject *__pyx_dict_cached_value = NULL;\
1861  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1862  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1863  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1864 }
1865 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1866  PY_UINT64_T __pyx_dict_version;\
1867  PyObject *__pyx_dict_cached_value;\
1868  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1869 }
1870 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1871 #else
1872 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1873 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1874 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1875 #endif
1876 
1877 /* PyIntBinop.proto */
1878 #if !CYTHON_COMPILING_IN_PYPY
1879 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1880 #else
1881 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1882  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1883 #endif
1884 
1885 /* PyCFunctionFastCall.proto */
1886 #if CYTHON_FAST_PYCCALL
1887 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1888 #else
1889 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1890 #endif
1891 
1892 /* PyFunctionFastCall.proto */
1893 #if CYTHON_FAST_PYCALL
1894 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1895  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1896 #if 1 || PY_VERSION_HEX < 0x030600B1
1897 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1898 #else
1899 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1900 #endif
1901 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1902  (sizeof(char [1 - 2*!(cond)]) - 1)
1903 #ifndef Py_MEMBER_SIZE
1904 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1905 #endif
1906  static size_t __pyx_pyframe_localsplus_offset = 0;
1907  #include "frameobject.h"
1908  #define __Pxy_PyFrame_Initialize_Offsets()\
1909  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1910  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1911  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1912  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1913 #endif
1914 
1915 /* PyObjectCall.proto */
1916 #if CYTHON_COMPILING_IN_CPYTHON
1917 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1918 #else
1919 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1920 #endif
1921 
1922 /* PyObjectCall2Args.proto */
1923 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1924 
1925 /* PyObjectCallMethO.proto */
1926 #if CYTHON_COMPILING_IN_CPYTHON
1927 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1928 #endif
1929 
1930 /* PyObjectCallOneArg.proto */
1931 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1932 
1933 /* PyObjectCallNoArg.proto */
1934 #if CYTHON_COMPILING_IN_CPYTHON
1935 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1936 #else
1937 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1938 #endif
1939 
1940 /* DictGetItem.proto */
1941 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1942 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1943 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1944  (likely(PyDict_CheckExact(obj)) ?\
1945  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1946 #else
1947 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1948 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1949 #endif
1950 
1951 /* RaiseTooManyValuesToUnpack.proto */
1952 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1953 
1954 /* RaiseNeedMoreValuesToUnpack.proto */
1955 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1956 
1957 /* RaiseNoneIterError.proto */
1958 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1959 
1960 /* ExtTypeTest.proto */
1961 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1962 
1963 /* PyThreadStateGet.proto */
1964 #if CYTHON_FAST_THREAD_STATE
1965 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1966 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1967 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1968 #else
1969 #define __Pyx_PyThreadState_declare
1970 #define __Pyx_PyThreadState_assign
1971 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1972 #endif
1973 
1974 /* PyErrFetchRestore.proto */
1975 #if CYTHON_FAST_THREAD_STATE
1976 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1977 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1978 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1979 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1980 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1981 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1982 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1983 #if CYTHON_COMPILING_IN_CPYTHON
1984 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1985 #else
1986 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1987 #endif
1988 #else
1989 #define __Pyx_PyErr_Clear() PyErr_Clear()
1990 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1991 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1992 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1993 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1994 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1995 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1996 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1997 #endif
1998 
1999 /* RaiseException.proto */
2000 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2001 
2002 /* GetTopmostException.proto */
2003 #if CYTHON_USE_EXC_INFO_STACK
2004 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2005 #endif
2006 
2007 /* SaveResetException.proto */
2008 #if CYTHON_FAST_THREAD_STATE
2009 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2010 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2011 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2012 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2013 #else
2014 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2015 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2016 #endif
2017 
2018 /* PyErrExceptionMatches.proto */
2019 #if CYTHON_FAST_THREAD_STATE
2020 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2021 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2022 #else
2023 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2024 #endif
2025 
2026 /* GetException.proto */
2027 #if CYTHON_FAST_THREAD_STATE
2028 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2029 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2030 #else
2031 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2032 #endif
2033 
2034 /* IncludeStringH.proto */
2035 #include <string.h>
2036 
2037 /* BytesEquals.proto */
2038 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2039 
2040 /* UnicodeEquals.proto */
2041 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2042 
2043 /* StrEquals.proto */
2044 #if PY_MAJOR_VERSION >= 3
2045 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2046 #else
2047 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2048 #endif
2049 
2050 /* None.proto */
2051 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2052 
2053 /* UnaryNegOverflows.proto */
2054 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2055  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2056 
2057 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2058 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2059 /* GetAttr.proto */
2060 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2061 
2062 /* GetItemInt.proto */
2063 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2064  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2065  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2066  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2067  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2068 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2069  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2070  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2071  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2072 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2073  int wraparound, int boundscheck);
2074 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2075  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2076  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2077  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2078 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2079  int wraparound, int boundscheck);
2080 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2081 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2082  int is_list, int wraparound, int boundscheck);
2083 
2084 /* ObjectGetItem.proto */
2085 #if CYTHON_USE_TYPE_SLOTS
2086 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2087 #else
2088 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2089 #endif
2090 
2091 /* decode_c_string_utf16.proto */
2092 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2093  int byteorder = 0;
2094  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2095 }
2096 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2097  int byteorder = -1;
2098  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2099 }
2100 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2101  int byteorder = 1;
2102  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2103 }
2104 
2105 /* decode_c_string.proto */
2106 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2107  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2108  const char* encoding, const char* errors,
2109  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2110 
2111 /* GetAttr3.proto */
2112 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2113 
2114 /* SwapException.proto */
2115 #if CYTHON_FAST_THREAD_STATE
2116 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2117 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2118 #else
2119 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2120 #endif
2121 
2122 /* Import.proto */
2123 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2124 
2125 /* FastTypeChecks.proto */
2126 #if CYTHON_COMPILING_IN_CPYTHON
2127 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2128 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2129 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2130 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2131 #else
2132 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2133 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2134 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2135 #endif
2136 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2137 
2138 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2139 /* ListCompAppend.proto */
2140 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2141 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2142  PyListObject* L = (PyListObject*) list;
2143  Py_ssize_t len = Py_SIZE(list);
2144  if (likely(L->allocated > len)) {
2145  Py_INCREF(x);
2146  PyList_SET_ITEM(list, len, x);
2147  __Pyx_SET_SIZE(list, len + 1);
2148  return 0;
2149  }
2150  return PyList_Append(list, x);
2151 }
2152 #else
2153 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2154 #endif
2155 
2156 /* ListExtend.proto */
2157 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2158 #if CYTHON_COMPILING_IN_CPYTHON
2159  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2160  if (unlikely(!none))
2161  return -1;
2162  Py_DECREF(none);
2163  return 0;
2164 #else
2165  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2166 #endif
2167 }
2168 
2169 /* ListAppend.proto */
2170 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2171 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2172  PyListObject* L = (PyListObject*) list;
2173  Py_ssize_t len = Py_SIZE(list);
2174  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2175  Py_INCREF(x);
2176  PyList_SET_ITEM(list, len, x);
2177  __Pyx_SET_SIZE(list, len + 1);
2178  return 0;
2179  }
2180  return PyList_Append(list, x);
2181 }
2182 #else
2183 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2184 #endif
2185 
2186 /* None.proto */
2187 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2188 
2189 /* None.proto */
2190 static CYTHON_INLINE long __Pyx_div_long(long, long);
2191 
2192 /* ImportFrom.proto */
2193 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2194 
2195 /* HasAttr.proto */
2196 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2197 
2198 /* StringJoin.proto */
2199 #if PY_MAJOR_VERSION < 3
2200 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
2201 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
2202 #else
2203 #define __Pyx_PyString_Join PyUnicode_Join
2204 #define __Pyx_PyBaseString_Join PyUnicode_Join
2205 #endif
2206 #if CYTHON_COMPILING_IN_CPYTHON
2207  #if PY_MAJOR_VERSION < 3
2208  #define __Pyx_PyBytes_Join _PyString_Join
2209  #else
2210  #define __Pyx_PyBytes_Join _PyBytes_Join
2211  #endif
2212 #else
2213 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
2214 #endif
2215 
2216 /* PyObject_Unicode.proto */
2217 #if PY_MAJOR_VERSION >= 3
2218 #define __Pyx_PyObject_Unicode(obj)\
2219  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2220 #else
2221 #define __Pyx_PyObject_Unicode(obj)\
2222  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
2223 #endif
2224 
2225 /* PyObject_GenericGetAttrNoDict.proto */
2226 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2227 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2228 #else
2229 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2230 #endif
2231 
2232 /* PyObject_GenericGetAttr.proto */
2233 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2234 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2235 #else
2236 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2237 #endif
2238 
2239 /* SetVTable.proto */
2240 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2241 
2242 /* PyObjectGetAttrStrNoError.proto */
2243 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2244 
2245 /* SetupReduce.proto */
2246 static int __Pyx_setup_reduce(PyObject* type_obj);
2247 
2248 /* TypeImport.proto */
2249 #ifndef __PYX_HAVE_RT_ImportType_proto
2250 #define __PYX_HAVE_RT_ImportType_proto
2251 enum __Pyx_ImportType_CheckSize {
2252  __Pyx_ImportType_CheckSize_Error = 0,
2253  __Pyx_ImportType_CheckSize_Warn = 1,
2254  __Pyx_ImportType_CheckSize_Ignore = 2
2255 };
2256 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2257 #endif
2258 
2259 /* CLineInTraceback.proto */
2260 #ifdef CYTHON_CLINE_IN_TRACEBACK
2261 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2262 #else
2263 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2264 #endif
2265 
2266 /* CodeObjectCache.proto */
2267 typedef struct {
2268  PyCodeObject* code_object;
2269  int code_line;
2270 } __Pyx_CodeObjectCacheEntry;
2271 struct __Pyx_CodeObjectCache {
2272  int count;
2273  int max_count;
2274  __Pyx_CodeObjectCacheEntry* entries;
2275 };
2276 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2277 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2278 static PyCodeObject *__pyx_find_code_object(int code_line);
2279 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2280 
2281 /* AddTraceback.proto */
2282 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2283  int py_line, const char *filename);
2284 
2285 /* CIntToPy.proto */
2286 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2287 
2288 /* MemviewDtypeToObject.proto */
2289 static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp);
2290 static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj);
2291 
2292 /* RealImag.proto */
2293 #if CYTHON_CCOMPLEX
2294  #ifdef __cplusplus
2295  #define __Pyx_CREAL(z) ((z).real())
2296  #define __Pyx_CIMAG(z) ((z).imag())
2297  #else
2298  #define __Pyx_CREAL(z) (__real__(z))
2299  #define __Pyx_CIMAG(z) (__imag__(z))
2300  #endif
2301 #else
2302  #define __Pyx_CREAL(z) ((z).real)
2303  #define __Pyx_CIMAG(z) ((z).imag)
2304 #endif
2305 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2306  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2307  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2308  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2309 #else
2310  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2311  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2312 #endif
2313 
2314 /* Arithmetic.proto */
2315 #if CYTHON_CCOMPLEX
2316  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2317  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2318  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2319  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2320  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2321  #define __Pyx_c_neg_float(a) (-(a))
2322  #ifdef __cplusplus
2323  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2324  #define __Pyx_c_conj_float(z) (::std::conj(z))
2325  #if 1
2326  #define __Pyx_c_abs_float(z) (::std::abs(z))
2327  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2328  #endif
2329  #else
2330  #define __Pyx_c_is_zero_float(z) ((z)==0)
2331  #define __Pyx_c_conj_float(z) (conjf(z))
2332  #if 1
2333  #define __Pyx_c_abs_float(z) (cabsf(z))
2334  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2335  #endif
2336  #endif
2337 #else
2338  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2339  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2340  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2341  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2342  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2343  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2344  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2345  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2346  #if 1
2347  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2348  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2349  #endif
2350 #endif
2351 
2352 /* Arithmetic.proto */
2353 #if CYTHON_CCOMPLEX
2354  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2355  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2356  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2357  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2358  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2359  #define __Pyx_c_neg_double(a) (-(a))
2360  #ifdef __cplusplus
2361  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2362  #define __Pyx_c_conj_double(z) (::std::conj(z))
2363  #if 1
2364  #define __Pyx_c_abs_double(z) (::std::abs(z))
2365  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2366  #endif
2367  #else
2368  #define __Pyx_c_is_zero_double(z) ((z)==0)
2369  #define __Pyx_c_conj_double(z) (conj(z))
2370  #if 1
2371  #define __Pyx_c_abs_double(z) (cabs(z))
2372  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2373  #endif
2374  #endif
2375 #else
2376  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2377  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2378  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2379  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2380  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2381  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2382  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2383  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2384  #if 1
2385  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2386  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2387  #endif
2388 #endif
2389 
2390 /* CIntToPy.proto */
2391 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2392 
2393 #if PY_MAJOR_VERSION < 3
2394  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2395  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2396 #else
2397  #define __Pyx_GetBuffer PyObject_GetBuffer
2398  #define __Pyx_ReleaseBuffer PyBuffer_Release
2399 #endif
2400 
2401 
2402 /* BufferStructDeclare.proto */
2403 typedef struct {
2404  Py_ssize_t shape, strides, suboffsets;
2405 } __Pyx_Buf_DimInfo;
2406 typedef struct {
2407  size_t refcount;
2408  Py_buffer pybuffer;
2409 } __Pyx_Buffer;
2410 typedef struct {
2411  __Pyx_Buffer *rcbuffer;
2412  char *data;
2413  __Pyx_Buf_DimInfo diminfo[8];
2414 } __Pyx_LocalBuf_ND;
2415 
2416 /* MemviewSliceIsContig.proto */
2417 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2418 
2419 /* OverlappingSlices.proto */
2420 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2421  __Pyx_memviewslice *slice2,
2422  int ndim, size_t itemsize);
2423 
2424 /* Capsule.proto */
2425 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2426 
2427 /* CIntFromPy.proto */
2428 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2429 
2430 /* TypeInfoToFormat.proto */
2431 struct __pyx_typeinfo_string {
2432  char string[3];
2433 };
2434 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2435 
2436 /* MemviewSliceCopyTemplate.proto */
2437 static __Pyx_memviewslice
2438 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2439  const char *mode, int ndim,
2440  size_t sizeof_dtype, int contig_flag,
2441  int dtype_is_object);
2442 
2443 /* MemviewSliceInit.proto */
2444 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2445 #define __Pyx_MEMVIEW_DIRECT 1
2446 #define __Pyx_MEMVIEW_PTR 2
2447 #define __Pyx_MEMVIEW_FULL 4
2448 #define __Pyx_MEMVIEW_CONTIG 8
2449 #define __Pyx_MEMVIEW_STRIDED 16
2450 #define __Pyx_MEMVIEW_FOLLOW 32
2451 #define __Pyx_IS_C_CONTIG 1
2452 #define __Pyx_IS_F_CONTIG 2
2453 static int __Pyx_init_memviewslice(
2454  struct __pyx_memoryview_obj *memview,
2455  int ndim,
2456  __Pyx_memviewslice *memviewslice,
2457  int memview_is_new_reference);
2458 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
2459  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2460 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
2461  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2462 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2463 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2464 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2465 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2466 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
2467 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
2468 
2469 /* CIntFromPy.proto */
2470 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2471 
2472 /* CIntToPy.proto */
2473 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2474 
2475 /* CIntFromPy.proto */
2476 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2477 
2478 /* CheckBinaryVersion.proto */
2479 static int __Pyx_check_binary_version(void);
2480 
2481 /* InitStrings.proto */
2482 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2483 
2484 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2485 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2486 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2487 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2488 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2489 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2490 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2491 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2492 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2493 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2494 
2495 /* Module declarations from 'cpython.buffer' */
2496 
2497 /* Module declarations from 'libc.string' */
2498 
2499 /* Module declarations from 'libc.stdio' */
2500 
2501 /* Module declarations from '__builtin__' */
2502 
2503 /* Module declarations from 'cpython.type' */
2504 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2505 
2506 /* Module declarations from 'cpython' */
2507 
2508 /* Module declarations from 'cpython.object' */
2509 
2510 /* Module declarations from 'cpython.ref' */
2511 
2512 /* Module declarations from 'cpython.mem' */
2513 
2514 /* Module declarations from 'numpy' */
2515 
2516 /* Module declarations from 'numpy' */
2517 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2518 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2519 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2520 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2521 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2522 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2523 
2524 /* Module declarations from 'mpi4py.libmpi' */
2525 
2526 /* Module declarations from 'mpi4py.MPI' */
2527 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Status = 0;
2528 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Datatype = 0;
2529 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Request = 0;
2530 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Prequest = 0;
2531 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Grequest = 0;
2532 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Message = 0;
2533 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Op = 0;
2534 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Group = 0;
2535 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Info = 0;
2536 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Errhandler = 0;
2537 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Comm = 0;
2538 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intracomm = 0;
2539 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Topocomm = 0;
2540 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Cartcomm = 0;
2541 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Graphcomm = 0;
2542 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Distgraphcomm = 0;
2543 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intercomm = 0;
2544 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Win = 0;
2545 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_File = 0;
2546 
2547 /* Module declarations from 'libcpp' */
2548 
2549 /* Module declarations from 'mesh' */
2550 
2551 /* Module declarations from 'proteus' */
2552 
2553 /* Module declarations from 'proteus.mesh' */
2554 
2555 /* Module declarations from 'proteus.cmeshTools' */
2556 static PyTypeObject *__pyx_ptype_7proteus_10cmeshTools_CMesh = 0;
2557 
2558 /* Module declarations from 'proteus.partitioning' */
2559 
2560 /* Module declarations from 'cpartitioning' */
2561 static PyTypeObject *__pyx_array_type = 0;
2562 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2563 static PyTypeObject *__pyx_memoryview_type = 0;
2564 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2565 static PyObject *generic = 0;
2566 static PyObject *strided = 0;
2567 static PyObject *indirect = 0;
2568 static PyObject *contiguous = 0;
2569 static PyObject *indirect_contiguous = 0;
2570 static int __pyx_memoryview_thread_locks_used;
2571 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2572 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2573 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2574 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2575 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2576 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2577 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2578 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2579 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2580 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2581 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2582 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2583 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2584 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2585 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2586 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2587 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2588 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2589 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2590 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2591 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2592 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2593 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2594 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2595 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2596 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2597 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2598 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2599 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2600 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2601 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2602 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2603 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2604 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2605 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/
2606 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2607 #define __Pyx_MODULE_NAME "cpartitioning"
2608 extern int __pyx_module_is_main_cpartitioning;
2609 int __pyx_module_is_main_cpartitioning = 0;
2610 
2611 /* Implementation of 'cpartitioning' */
2612 static PyObject *__pyx_builtin_RuntimeError;
2613 static PyObject *__pyx_builtin_ValueError;
2614 static PyObject *__pyx_builtin_ImportError;
2615 static PyObject *__pyx_builtin_MemoryError;
2616 static PyObject *__pyx_builtin_enumerate;
2617 static PyObject *__pyx_builtin_range;
2618 static PyObject *__pyx_builtin_TypeError;
2619 static PyObject *__pyx_builtin_Ellipsis;
2620 static PyObject *__pyx_builtin_id;
2621 static PyObject *__pyx_builtin_IndexError;
2622 static const char __pyx_k_O[] = "O";
2623 static const char __pyx_k_T[] = "T{";
2624  static const char __pyx_k_c[] = "c";
2625  static const char __pyx_k_s[] = "(%s)";
2626  static const char __pyx_k_id[] = "id";
2627  static const char __pyx_k_np[] = "np";
2628  static const char __pyx_k__24[] = "^";
2629  static const char __pyx_k__25[] = "";
2630  static const char __pyx_k__26[] = ":";
2631 static const char __pyx_k__27[] = "}";
2632 static const char __pyx_k__28[] = ",";
2633 static const char __pyx_k_new[] = "__new__";
2634 static const char __pyx_k_obj[] = "obj";
2635 static const char __pyx_k_Comm[] = "Comm";
2636 static const char __pyx_k_base[] = "base";
2637 static const char __pyx_k_comm[] = "comm";
2638 static const char __pyx_k_dict[] = "__dict__";
2639 static const char __pyx_k_join[] = "join";
2640 static const char __pyx_k_main[] = "__main__";
2641 static const char __pyx_k_mode[] = "mode";
2642 static const char __pyx_k_name[] = "name";
2643 static const char __pyx_k_ndim[] = "ndim";
2644 static const char __pyx_k_pack[] = "pack";
2645 static const char __pyx_k_size[] = "size";
2646 static const char __pyx_k_step[] = "step";
2647 static const char __pyx_k_stop[] = "stop";
2648 static const char __pyx_k_test[] = "__test__";
2649 static const char __pyx_k_ASCII[] = "ASCII";
2650 static const char __pyx_k_class[] = "__class__";
2651 static const char __pyx_k_cmesh[] = "cmesh";
2652 static const char __pyx_k_error[] = "error";
2653 static const char __pyx_k_flags[] = "flags";
2654 static const char __pyx_k_numpy[] = "numpy";
2655 static const char __pyx_k_range[] = "range";
2656 static const char __pyx_k_shape[] = "shape";
2657 static const char __pyx_k_start[] = "start";
2658 static const char __pyx_k_encode[] = "encode";
2659 static const char __pyx_k_format[] = "format";
2660 static const char __pyx_k_import[] = "__import__";
2661 static const char __pyx_k_nSpace[] = "nSpace";
2662 static const char __pyx_k_name_2[] = "__name__";
2663 static const char __pyx_k_pickle[] = "pickle";
2664 static const char __pyx_k_reduce[] = "__reduce__";
2665 static const char __pyx_k_struct[] = "struct";
2666 static const char __pyx_k_unpack[] = "unpack";
2667 static const char __pyx_k_update[] = "update";
2668 static const char __pyx_k_asarray[] = "asarray";
2669 static const char __pyx_k_fortran[] = "fortran";
2670 static const char __pyx_k_memview[] = "memview";
2671 static const char __pyx_k_proteus[] = "proteus";
2672 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2673 static const char __pyx_k_filebase[] = "filebase";
2674 static const char __pyx_k_getstate[] = "__getstate__";
2675 static const char __pyx_k_itemsize[] = "itemsize";
2676 static const char __pyx_k_pyx_type[] = "__pyx_type";
2677 static const char __pyx_k_setstate[] = "__setstate__";
2678 static const char __pyx_k_TypeError[] = "TypeError";
2679 static const char __pyx_k_enumerate[] = "enumerate";
2680 static const char __pyx_k_indexBase[] = "indexBase";
2681 static const char __pyx_k_pyx_state[] = "__pyx_state";
2682 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2683 static const char __pyx_k_IndexError[] = "IndexError";
2684 static const char __pyx_k_ValueError[] = "ValueError";
2685 static const char __pyx_k_pyx_result[] = "__pyx_result";
2686 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2687 static const char __pyx_k_ImportError[] = "ImportError";
2688 static const char __pyx_k_MemoryError[] = "MemoryError";
2689 static const char __pyx_k_PickleError[] = "PickleError";
2690 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2691 static const char __pyx_k_nDOF_element[] = "nDOF_element";
2692 static const char __pyx_k_proteus_Comm[] = "proteus_Comm";
2693 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2694 static const char __pyx_k_stringsource[] = "stringsource";
2695 static const char __pyx_k_cpartitioning[] = "cpartitioning";
2696 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2697 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2698 static const char __pyx_k_nDOF_subdomain[] = "nDOF_subdomain";
2699 static const char __pyx_k_partitionNodes[] = "partitionNodes";
2700 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2701 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2702 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2703 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2704 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2705 static const char __pyx_k_subdomain_cmesh[] = "subdomain_cmesh";
2706 static const char __pyx_k_dg_subdomain_l2g[] = "dg_subdomain_l2g";
2707 static const char __pyx_k_nLayersOfOverlap[] = "nLayersOfOverlap";
2708 static const char __pyx_k_max_dof_neighbors[] = "max_dof_neighbors";
2709 static const char __pyx_k_partitionElements[] = "partitionElements";
2710 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2711 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2712 static const char __pyx_k_nDOF_all_processes[] = "nDOF_all_processes";
2713 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2714 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2715 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2716 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2717 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2718 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2719 static const char __pyx_k_quadratic_lagrangeNodes[] = "quadratic_lagrangeNodes";
2720 static const char __pyx_k_quadratic_subdomain_l2g[] = "quadratic_subdomain_l2g";
2721 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2722 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2723 static const char __pyx_k_proteus_cpartitioning_pyx[] = "proteus/cpartitioning.pyx";
2724 static const char __pyx_k_edgeOffsets_subdomain_owned[] = "edgeOffsets_subdomain_owned";
2725 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2726 static const char __pyx_k_nodeOffsets_subdomain_owned[] = "nodeOffsets_subdomain_owned";
2727 static const char __pyx_k_convertPUMIPartitionToPython[] = "convertPUMIPartitionToPython";
2728 static const char __pyx_k_dgNumbering_subdomain2global[] = "dgNumbering_subdomain2global";
2729 static const char __pyx_k_partitionNodesFromTetgenFiles[] = "partitionNodesFromTetgenFiles";
2730 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2731 static const char __pyx_k_dg_dof_offsets_subdomain_owned[] = "dg_dof_offsets_subdomain_owned";
2732 static const char __pyx_k_edgeNumbering_subdomain2global[] = "edgeNumbering_subdomain2global";
2733 static const char __pyx_k_elementOffsets_subdomain_owned[] = "elementOffsets_subdomain_owned";
2734 static const char __pyx_k_nodeNumbering_subdomain2global[] = "nodeNumbering_subdomain2global";
2735 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2736 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2737 static const char __pyx_k_quadratic_dof_offsets_subdomain[] = "quadratic_dof_offsets_subdomain_owned";
2738 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2739 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2740 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2741 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2742 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2743 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2744 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2745 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2746 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2747 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2748 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2749 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2750 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2751 static const char __pyx_k_buildDiscontinuousGalerkinLocal2[] = "buildDiscontinuousGalerkinLocal2GlobalMappings";
2752 static const char __pyx_k_buildQuadraticCubeLocal2GlobalMa[] = "buildQuadraticCubeLocal2GlobalMappings";
2753 static const char __pyx_k_buildQuadraticCubeSubdomain2Glob[] = "buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!";
2754 static const char __pyx_k_buildQuadraticLocal2GlobalMappin[] = "buildQuadraticLocal2GlobalMappings";
2755 static const char __pyx_k_elementBoundaryNumbering_subdoma[] = "elementBoundaryNumbering_subdomain2global";
2756 static const char __pyx_k_elementBoundaryOffsets_subdomain[] = "elementBoundaryOffsets_subdomain_owned";
2757 static const char __pyx_k_elementNumbering_subdomain2globa[] = "elementNumbering_subdomain2global";
2758 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2759 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2760 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2761 static const char __pyx_k_quadraticNumbering_subdomain2glo[] = "quadraticNumbering_subdomain2global";
2762 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2763 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2764 static const char __pyx_k_buildQuadraticCubeSubdomain2Glob_2[] = "buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!";
2765 static PyObject *__pyx_n_s_ASCII;
2766 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2767 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2768 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2769 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2770 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2771 static PyObject *__pyx_n_s_Comm;
2772 static PyObject *__pyx_n_s_Ellipsis;
2773 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2774 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2775 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2776 static PyObject *__pyx_n_s_ImportError;
2777 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2778 static PyObject *__pyx_n_s_IndexError;
2779 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2780 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2781 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2782 static PyObject *__pyx_n_s_MemoryError;
2783 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2784 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2785 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2786 static PyObject *__pyx_n_b_O;
2787 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2788 static PyObject *__pyx_n_s_PickleError;
2789 static PyObject *__pyx_n_s_RuntimeError;
2790 static PyObject *__pyx_kp_b_T;
2791 static PyObject *__pyx_n_s_TypeError;
2792 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2793 static PyObject *__pyx_n_s_ValueError;
2794 static PyObject *__pyx_n_s_View_MemoryView;
2795 static PyObject *__pyx_kp_b__24;
2796 static PyObject *__pyx_kp_b__25;
2797 static PyObject *__pyx_kp_b__26;
2798 static PyObject *__pyx_kp_b__27;
2799 static PyObject *__pyx_kp_u__28;
2800 static PyObject *__pyx_n_s_allocate_buffer;
2801 static PyObject *__pyx_n_s_asarray;
2802 static PyObject *__pyx_n_s_base;
2803 static PyObject *__pyx_n_s_buildDiscontinuousGalerkinLocal2;
2804 static PyObject *__pyx_n_s_buildQuadraticCubeLocal2GlobalMa;
2805 static PyObject *__pyx_kp_s_buildQuadraticCubeSubdomain2Glob;
2806 static PyObject *__pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2;
2807 static PyObject *__pyx_n_s_buildQuadraticLocal2GlobalMappin;
2808 static PyObject *__pyx_n_s_c;
2809 static PyObject *__pyx_n_u_c;
2810 static PyObject *__pyx_n_s_class;
2811 static PyObject *__pyx_n_s_cline_in_traceback;
2812 static PyObject *__pyx_n_s_cmesh;
2813 static PyObject *__pyx_n_s_comm;
2814 static PyObject *__pyx_kp_s_contiguous_and_direct;
2815 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2816 static PyObject *__pyx_n_s_convertPUMIPartitionToPython;
2817 static PyObject *__pyx_n_s_cpartitioning;
2818 static PyObject *__pyx_n_s_dgNumbering_subdomain2global;
2819 static PyObject *__pyx_n_s_dg_dof_offsets_subdomain_owned;
2820 static PyObject *__pyx_n_s_dg_subdomain_l2g;
2821 static PyObject *__pyx_n_s_dict;
2822 static PyObject *__pyx_n_s_dtype_is_object;
2823 static PyObject *__pyx_n_s_edgeNumbering_subdomain2global;
2824 static PyObject *__pyx_n_s_edgeOffsets_subdomain_owned;
2825 static PyObject *__pyx_n_s_elementBoundaryNumbering_subdoma;
2826 static PyObject *__pyx_n_s_elementBoundaryOffsets_subdomain;
2827 static PyObject *__pyx_n_s_elementNumbering_subdomain2globa;
2828 static PyObject *__pyx_n_s_elementOffsets_subdomain_owned;
2829 static PyObject *__pyx_n_s_encode;
2830 static PyObject *__pyx_n_s_enumerate;
2831 static PyObject *__pyx_n_s_error;
2832 static PyObject *__pyx_n_s_filebase;
2833 static PyObject *__pyx_n_s_flags;
2834 static PyObject *__pyx_n_s_format;
2835 static PyObject *__pyx_n_s_fortran;
2836 static PyObject *__pyx_n_u_fortran;
2837 static PyObject *__pyx_n_s_getstate;
2838 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2839 static PyObject *__pyx_n_s_id;
2840 static PyObject *__pyx_n_s_import;
2841 static PyObject *__pyx_n_s_indexBase;
2842 static PyObject *__pyx_n_s_itemsize;
2843 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2844 static PyObject *__pyx_n_s_join;
2845 static PyObject *__pyx_n_s_main;
2846 static PyObject *__pyx_n_s_max_dof_neighbors;
2847 static PyObject *__pyx_n_s_memview;
2848 static PyObject *__pyx_n_s_mode;
2849 static PyObject *__pyx_n_s_nDOF_all_processes;
2850 static PyObject *__pyx_n_s_nDOF_element;
2851 static PyObject *__pyx_n_s_nDOF_subdomain;
2852 static PyObject *__pyx_n_s_nLayersOfOverlap;
2853 static PyObject *__pyx_n_s_nSpace;
2854 static PyObject *__pyx_n_s_name;
2855 static PyObject *__pyx_n_s_name_2;
2856 static PyObject *__pyx_n_s_ndim;
2857 static PyObject *__pyx_n_s_new;
2858 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2859 static PyObject *__pyx_n_s_nodeNumbering_subdomain2global;
2860 static PyObject *__pyx_n_s_nodeOffsets_subdomain_owned;
2861 static PyObject *__pyx_n_s_np;
2862 static PyObject *__pyx_n_s_numpy;
2863 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2864 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2865 static PyObject *__pyx_n_s_obj;
2866 static PyObject *__pyx_n_s_pack;
2867 static PyObject *__pyx_n_s_partitionElements;
2868 static PyObject *__pyx_n_s_partitionNodes;
2869 static PyObject *__pyx_n_s_partitionNodesFromTetgenFiles;
2870 static PyObject *__pyx_n_s_pickle;
2871 static PyObject *__pyx_n_s_proteus;
2872 static PyObject *__pyx_n_s_proteus_Comm;
2873 static PyObject *__pyx_kp_s_proteus_cpartitioning_pyx;
2874 static PyObject *__pyx_n_s_pyx_PickleError;
2875 static PyObject *__pyx_n_s_pyx_checksum;
2876 static PyObject *__pyx_n_s_pyx_getbuffer;
2877 static PyObject *__pyx_n_s_pyx_result;
2878 static PyObject *__pyx_n_s_pyx_state;
2879 static PyObject *__pyx_n_s_pyx_type;
2880 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2881 static PyObject *__pyx_n_s_pyx_vtable;
2882 static PyObject *__pyx_n_s_quadraticNumbering_subdomain2glo;
2883 static PyObject *__pyx_n_s_quadratic_dof_offsets_subdomain;
2884 static PyObject *__pyx_n_s_quadratic_lagrangeNodes;
2885 static PyObject *__pyx_n_s_quadratic_subdomain_l2g;
2886 static PyObject *__pyx_n_s_range;
2887 static PyObject *__pyx_n_s_reduce;
2888 static PyObject *__pyx_n_s_reduce_cython;
2889 static PyObject *__pyx_n_s_reduce_ex;
2890 static PyObject *__pyx_kp_u_s;
2891 static PyObject *__pyx_n_s_setstate;
2892 static PyObject *__pyx_n_s_setstate_cython;
2893 static PyObject *__pyx_n_s_shape;
2894 static PyObject *__pyx_n_s_size;
2895 static PyObject *__pyx_n_s_start;
2896 static PyObject *__pyx_n_s_step;
2897 static PyObject *__pyx_n_s_stop;
2898 static PyObject *__pyx_kp_s_strided_and_direct;
2899 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2900 static PyObject *__pyx_kp_s_strided_and_indirect;
2901 static PyObject *__pyx_kp_s_stringsource;
2902 static PyObject *__pyx_n_s_struct;
2903 static PyObject *__pyx_n_s_subdomain_cmesh;
2904 static PyObject *__pyx_n_s_test;
2905 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2906 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2907 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2908 static PyObject *__pyx_n_s_unpack;
2909 static PyObject *__pyx_n_s_update;
2910 static PyObject *__pyx_pf_13cpartitioning_partitionElements(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2911 static PyObject *__pyx_pf_13cpartitioning_2partitionNodes(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2912 static PyObject *__pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2913 static PyObject *__pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2914 static PyObject *__pyx_pf_13cpartitioning_8buildQuadraticLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes); /* proto */
2915 static PyObject *__pyx_pf_13cpartitioning_10buildQuadraticCubeLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes); /* proto */
2916 static PyObject *__pyx_pf_13cpartitioning_12buildDiscontinuousGalerkinLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nDOF_element, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_dg_subdomain_l2g, PyArrayObject *__pyx_v_dgNumbering_subdomain2global); /* proto */
2917 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2918 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2919 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2920 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2921 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2922 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2923 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2924 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2925 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2926 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2927 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2928 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2929 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2930 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2931 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2932 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2933 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2934 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2935 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2936 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2937 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2938 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2939 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2940 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2941 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2942 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2943 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2944 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2945 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2946 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2947 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2948 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2949 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2950 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2951 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2952 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2953 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2954 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2955 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2956 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2957 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2958 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2959 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2960 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2961 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2962 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2963 static PyObject *__pyx_int_0;
2964 static PyObject *__pyx_int_1;
2965 static PyObject *__pyx_int_184977713;
2966 static PyObject *__pyx_int_neg_1;
2967 static PyObject *__pyx_tuple_;
2968 static PyObject *__pyx_tuple__2;
2969 static PyObject *__pyx_tuple__3;
2970 static PyObject *__pyx_tuple__4;
2971 static PyObject *__pyx_tuple__5;
2972 static PyObject *__pyx_tuple__6;
2973 static PyObject *__pyx_tuple__7;
2974 static PyObject *__pyx_tuple__8;
2975 static PyObject *__pyx_tuple__9;
2976 static PyObject *__pyx_slice__20;
2977 static PyObject *__pyx_tuple__10;
2978 static PyObject *__pyx_tuple__11;
2979 static PyObject *__pyx_tuple__12;
2980 static PyObject *__pyx_tuple__13;
2981 static PyObject *__pyx_tuple__14;
2982 static PyObject *__pyx_tuple__15;
2983 static PyObject *__pyx_tuple__16;
2984 static PyObject *__pyx_tuple__17;
2985 static PyObject *__pyx_tuple__18;
2986 static PyObject *__pyx_tuple__19;
2987 static PyObject *__pyx_tuple__21;
2988 static PyObject *__pyx_tuple__22;
2989 static PyObject *__pyx_tuple__23;
2990 static PyObject *__pyx_tuple__29;
2991 static PyObject *__pyx_tuple__31;
2992 static PyObject *__pyx_tuple__33;
2993 static PyObject *__pyx_tuple__35;
2994 static PyObject *__pyx_tuple__37;
2995 static PyObject *__pyx_tuple__39;
2996 static PyObject *__pyx_tuple__41;
2997 static PyObject *__pyx_tuple__43;
2998 static PyObject *__pyx_tuple__44;
2999 static PyObject *__pyx_tuple__45;
3000 static PyObject *__pyx_tuple__46;
3001 static PyObject *__pyx_tuple__47;
3002 static PyObject *__pyx_tuple__48;
3003 static PyObject *__pyx_codeobj__30;
3004 static PyObject *__pyx_codeobj__32;
3005 static PyObject *__pyx_codeobj__34;
3006 static PyObject *__pyx_codeobj__36;
3007 static PyObject *__pyx_codeobj__38;
3008 static PyObject *__pyx_codeobj__40;
3009 static PyObject *__pyx_codeobj__42;
3010 static PyObject *__pyx_codeobj__49;
3011 /* Late includes */
3012 
3013 /* "cpartitioning.pyx":19
3014  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
3015  *
3016  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3017  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3018  * c_partitionElements(comm.ob_mpi,
3019  */
3020 
3021 /* Python wrapper */
3022 static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3023 static PyMethodDef __pyx_mdef_13cpartitioning_1partitionElements = {"partitionElements", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_1partitionElements, METH_VARARGS|METH_KEYWORDS, 0};
3024 static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3025  struct PyMPICommObject *__pyx_v_comm = 0;
3026  int __pyx_v_nLayersOfOverlap;
3027  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3028  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
3029  int __pyx_lineno = 0;
3030  const char *__pyx_filename = NULL;
3031  int __pyx_clineno = 0;
3032  PyObject *__pyx_r = 0;
3033  __Pyx_RefNannyDeclarations
3034  __Pyx_RefNannySetupContext("partitionElements (wrapper)", 0);
3035  {
3036  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
3037  PyObject* values[4] = {0,0,0,0};
3038  if (unlikely(__pyx_kwds)) {
3039  Py_ssize_t kw_args;
3040  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3041  switch (pos_args) {
3042  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3043  CYTHON_FALLTHROUGH;
3044  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3045  CYTHON_FALLTHROUGH;
3046  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3047  CYTHON_FALLTHROUGH;
3048  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3049  CYTHON_FALLTHROUGH;
3050  case 0: break;
3051  default: goto __pyx_L5_argtuple_error;
3052  }
3053  kw_args = PyDict_Size(__pyx_kwds);
3054  switch (pos_args) {
3055  case 0:
3056  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
3057  else goto __pyx_L5_argtuple_error;
3058  CYTHON_FALLTHROUGH;
3059  case 1:
3060  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
3061  else {
3062  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 1); __PYX_ERR(0, 19, __pyx_L3_error)
3063  }
3064  CYTHON_FALLTHROUGH;
3065  case 2:
3066  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3067  else {
3068  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 2); __PYX_ERR(0, 19, __pyx_L3_error)
3069  }
3070  CYTHON_FALLTHROUGH;
3071  case 3:
3072  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
3073  else {
3074  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 3); __PYX_ERR(0, 19, __pyx_L3_error)
3075  }
3076  }
3077  if (unlikely(kw_args > 0)) {
3078  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionElements") < 0)) __PYX_ERR(0, 19, __pyx_L3_error)
3079  }
3080  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3081  goto __pyx_L5_argtuple_error;
3082  } else {
3083  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3084  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3085  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3086  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3087  }
3088  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
3089  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
3090  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
3091  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
3092  }
3093  goto __pyx_L4_argument_unpacking_done;
3094  __pyx_L5_argtuple_error:;
3095  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 19, __pyx_L3_error)
3096  __pyx_L3_error:;
3097  __Pyx_AddTraceback("cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3098  __Pyx_RefNannyFinishContext();
3099  return NULL;
3100  __pyx_L4_argument_unpacking_done:;
3101  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
3102  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
3103  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
3104  __pyx_r = __pyx_pf_13cpartitioning_partitionElements(__pyx_self, __pyx_v_comm, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
3105 
3106  /* function exit code */
3107  goto __pyx_L0;
3108  __pyx_L1_error:;
3109  __pyx_r = NULL;
3110  __pyx_L0:;
3111  __Pyx_RefNannyFinishContext();
3112  return __pyx_r;
3113 }
3114 
3115 static PyObject *__pyx_pf_13cpartitioning_partitionElements(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
3116  PyObject *__pyx_r = NULL;
3117  __Pyx_RefNannyDeclarations
3118  PyObject *__pyx_t_1 = NULL;
3119  PyObject *__pyx_t_2 = NULL;
3120  PyObject *__pyx_t_3 = NULL;
3121  int *__pyx_t_4;
3122  PyObject *__pyx_t_5 = NULL;
3123  Py_ssize_t __pyx_t_6;
3124  struct __pyx_array_obj *__pyx_t_7 = NULL;
3125  PyObject *__pyx_t_8 = NULL;
3126  PyObject *__pyx_t_9 = NULL;
3127  PyObject *__pyx_t_10 = NULL;
3128  PyObject *__pyx_t_11 = NULL;
3129  PyObject *__pyx_t_12 = NULL;
3130  PyObject *__pyx_t_13 = NULL;
3131  PyObject *__pyx_t_14 = NULL;
3132  int __pyx_lineno = 0;
3133  const char *__pyx_filename = NULL;
3134  int __pyx_clineno = 0;
3135  __Pyx_RefNannySetupContext("partitionElements", 0);
3136 
3137  /* "cpartitioning.pyx":20
3138  *
3139  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3140  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
3141  * c_partitionElements(comm.ob_mpi,
3142  * cmesh.mesh,
3143  */
3144  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
3145 
3146  /* "cpartitioning.pyx":21
3147  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3148  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3149  * c_partitionElements(comm.ob_mpi, # <<<<<<<<<<<<<<
3150  * cmesh.mesh,
3151  * nLayersOfOverlap)
3152  */
3153  (void)(proteus::partitionElements(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
3154 
3155  /* "cpartitioning.pyx":24
3156  * cmesh.mesh,
3157  * nLayersOfOverlap)
3158  * return ( # <<<<<<<<<<<<<<
3159  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3160  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3161  */
3162  __Pyx_XDECREF(__pyx_r);
3163 
3164  /* "cpartitioning.pyx":25
3165  * nLayersOfOverlap)
3166  * return (
3167  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3168  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3169  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3170  */
3171  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
3172  __Pyx_GOTREF(__pyx_t_2);
3173  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
3174  __Pyx_GOTREF(__pyx_t_3);
3175  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3176  __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
3177  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
3178  __Pyx_GOTREF(__pyx_t_2);
3179  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 25, __pyx_L1_error)
3180  __Pyx_GOTREF(__pyx_t_5);
3181  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3182  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 25, __pyx_L1_error)
3183  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3184  if (!__pyx_t_4) {
3185  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3186  __PYX_ERR(0, 25, __pyx_L1_error)
3187  }
3188  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
3189  __Pyx_GOTREF(__pyx_t_2);
3190  __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 25, __pyx_L1_error)
3191  __Pyx_GOTREF(__pyx_t_5);
3192  __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(int), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_4);
3193  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 25, __pyx_L1_error)
3194  __Pyx_GOTREF(__pyx_t_7);
3195  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3196  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3197  __pyx_t_2 = NULL;
3198  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3199  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3200  if (likely(__pyx_t_2)) {
3201  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3202  __Pyx_INCREF(__pyx_t_2);
3203  __Pyx_INCREF(function);
3204  __Pyx_DECREF_SET(__pyx_t_3, function);
3205  }
3206  }
3207  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
3208  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3209  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3210  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
3211  __Pyx_GOTREF(__pyx_t_1);
3212  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3213 
3214  /* "cpartitioning.pyx":26
3215  * return (
3216  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3217  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
3218  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3219  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3220  */
3221  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3222  __Pyx_GOTREF(__pyx_t_2);
3223  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
3224  __Pyx_GOTREF(__pyx_t_5);
3225  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3226  __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
3227  if (!__pyx_t_4) {
3228  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3229  __PYX_ERR(0, 26, __pyx_L1_error)
3230  }
3231  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 26, __pyx_L1_error)
3232  __Pyx_GOTREF(__pyx_t_8);
3233  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3234  __Pyx_GOTREF(__pyx_t_2);
3235  __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3236  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 26, __pyx_L1_error)
3237  __Pyx_GOTREF(__pyx_t_7);
3238  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3239  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3240  __pyx_t_8 = NULL;
3241  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3242  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
3243  if (likely(__pyx_t_8)) {
3244  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3245  __Pyx_INCREF(__pyx_t_8);
3246  __Pyx_INCREF(function);
3247  __Pyx_DECREF_SET(__pyx_t_5, function);
3248  }
3249  }
3250  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
3251  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3252  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3253  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
3254  __Pyx_GOTREF(__pyx_t_3);
3255  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3256 
3257  /* "cpartitioning.pyx":27
3258  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3259  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3260  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3261  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3262  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3263  */
3264  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 27, __pyx_L1_error)
3265  __Pyx_GOTREF(__pyx_t_8);
3266  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3267  __Pyx_GOTREF(__pyx_t_2);
3268  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3269  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
3270  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 27, __pyx_L1_error)
3271  __Pyx_GOTREF(__pyx_t_8);
3272  __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 27, __pyx_L1_error)
3273  __Pyx_GOTREF(__pyx_t_9);
3274  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3275  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L1_error)
3276  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3277  if (!__pyx_t_4) {
3278  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3279  __PYX_ERR(0, 27, __pyx_L1_error)
3280  }
3281  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 27, __pyx_L1_error)
3282  __Pyx_GOTREF(__pyx_t_8);
3283  __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 27, __pyx_L1_error)
3284  __Pyx_GOTREF(__pyx_t_9);
3285  __pyx_t_7 = __pyx_array_new(__pyx_t_9, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3286  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 27, __pyx_L1_error)
3287  __Pyx_GOTREF(__pyx_t_7);
3288  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3289  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3290  __pyx_t_8 = NULL;
3291  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3292  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
3293  if (likely(__pyx_t_8)) {
3294  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3295  __Pyx_INCREF(__pyx_t_8);
3296  __Pyx_INCREF(function);
3297  __Pyx_DECREF_SET(__pyx_t_2, function);
3298  }
3299  }
3300  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
3301  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3302  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3303  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error)
3304  __Pyx_GOTREF(__pyx_t_5);
3305  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3306 
3307  /* "cpartitioning.pyx":28
3308  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3309  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3310  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
3311  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3312  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3313  */
3314  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error)
3315  __Pyx_GOTREF(__pyx_t_8);
3316  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 28, __pyx_L1_error)
3317  __Pyx_GOTREF(__pyx_t_9);
3318  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3319  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
3320  if (!__pyx_t_4) {
3321  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3322  __PYX_ERR(0, 28, __pyx_L1_error)
3323  }
3324  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 28, __pyx_L1_error)
3325  __Pyx_GOTREF(__pyx_t_10);
3326  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error)
3327  __Pyx_GOTREF(__pyx_t_8);
3328  __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3329  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 28, __pyx_L1_error)
3330  __Pyx_GOTREF(__pyx_t_7);
3331  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3332  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3333  __pyx_t_10 = NULL;
3334  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
3335  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
3336  if (likely(__pyx_t_10)) {
3337  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
3338  __Pyx_INCREF(__pyx_t_10);
3339  __Pyx_INCREF(function);
3340  __Pyx_DECREF_SET(__pyx_t_9, function);
3341  }
3342  }
3343  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
3344  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3345  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3346  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
3347  __Pyx_GOTREF(__pyx_t_2);
3348  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3349 
3350  /* "cpartitioning.pyx":29
3351  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3352  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3353  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3354  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3355  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3356  */
3357  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 29, __pyx_L1_error)
3358  __Pyx_GOTREF(__pyx_t_10);
3359  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error)
3360  __Pyx_GOTREF(__pyx_t_8);
3361  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3362  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
3363  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 29, __pyx_L1_error)
3364  __Pyx_GOTREF(__pyx_t_10);
3365  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 29, __pyx_L1_error)
3366  __Pyx_GOTREF(__pyx_t_11);
3367  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3368  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L1_error)
3369  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3370  if (!__pyx_t_4) {
3371  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3372  __PYX_ERR(0, 29, __pyx_L1_error)
3373  }
3374  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 29, __pyx_L1_error)
3375  __Pyx_GOTREF(__pyx_t_10);
3376  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 29, __pyx_L1_error)
3377  __Pyx_GOTREF(__pyx_t_11);
3378  __pyx_t_7 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3379  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 29, __pyx_L1_error)
3380  __Pyx_GOTREF(__pyx_t_7);
3381  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3382  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3383  __pyx_t_10 = NULL;
3384  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
3385  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
3386  if (likely(__pyx_t_10)) {
3387  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
3388  __Pyx_INCREF(__pyx_t_10);
3389  __Pyx_INCREF(function);
3390  __Pyx_DECREF_SET(__pyx_t_8, function);
3391  }
3392  }
3393  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
3394  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3395  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3396  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 29, __pyx_L1_error)
3397  __Pyx_GOTREF(__pyx_t_9);
3398  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3399 
3400  /* "cpartitioning.pyx":30
3401  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3402  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3403  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
3404  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3405  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
3406  */
3407  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 30, __pyx_L1_error)
3408  __Pyx_GOTREF(__pyx_t_10);
3409  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 30, __pyx_L1_error)
3410  __Pyx_GOTREF(__pyx_t_11);
3411  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3412  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
3413  if (!__pyx_t_4) {
3414  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3415  __PYX_ERR(0, 30, __pyx_L1_error)
3416  }
3417  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 30, __pyx_L1_error)
3418  __Pyx_GOTREF(__pyx_t_12);
3419  __pyx_t_10 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 30, __pyx_L1_error)
3420  __Pyx_GOTREF(__pyx_t_10);
3421  __pyx_t_7 = __pyx_array_new(__pyx_t_10, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
3422  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 30, __pyx_L1_error)
3423  __Pyx_GOTREF(__pyx_t_7);
3424  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3425  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3426  __pyx_t_12 = NULL;
3427  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
3428  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
3429  if (likely(__pyx_t_12)) {
3430  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
3431  __Pyx_INCREF(__pyx_t_12);
3432  __Pyx_INCREF(function);
3433  __Pyx_DECREF_SET(__pyx_t_11, function);
3434  }
3435  }
3436  __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
3437  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3438  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3439  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 30, __pyx_L1_error)
3440  __Pyx_GOTREF(__pyx_t_8);
3441  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3442 
3443  /* "cpartitioning.pyx":31
3444  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3445  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3446  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3447  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
3448  * )
3449  */
3450  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 31, __pyx_L1_error)
3451  __Pyx_GOTREF(__pyx_t_12);
3452  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 31, __pyx_L1_error)
3453  __Pyx_GOTREF(__pyx_t_10);
3454  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3455  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
3456  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 31, __pyx_L1_error)
3457  __Pyx_GOTREF(__pyx_t_12);
3458  __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 31, __pyx_L1_error)
3459  __Pyx_GOTREF(__pyx_t_13);
3460  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3461  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
3462  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3463  if (!__pyx_t_4) {
3464  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3465  __PYX_ERR(0, 31, __pyx_L1_error)
3466  }
3467  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 31, __pyx_L1_error)
3468  __Pyx_GOTREF(__pyx_t_12);
3469  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 31, __pyx_L1_error)
3470  __Pyx_GOTREF(__pyx_t_13);
3471  __pyx_t_7 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
3472  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 31, __pyx_L1_error)
3473  __Pyx_GOTREF(__pyx_t_7);
3474  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3475  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3476  __pyx_t_12 = NULL;
3477  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
3478  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
3479  if (likely(__pyx_t_12)) {
3480  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
3481  __Pyx_INCREF(__pyx_t_12);
3482  __Pyx_INCREF(function);
3483  __Pyx_DECREF_SET(__pyx_t_10, function);
3484  }
3485  }
3486  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
3487  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3488  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3489  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 31, __pyx_L1_error)
3490  __Pyx_GOTREF(__pyx_t_11);
3491  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3492 
3493  /* "cpartitioning.pyx":32
3494  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3495  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3496  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
3497  * )
3498  *
3499  */
3500  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 32, __pyx_L1_error)
3501  __Pyx_GOTREF(__pyx_t_12);
3502  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 32, __pyx_L1_error)
3503  __Pyx_GOTREF(__pyx_t_13);
3504  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3505  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
3506  if (!__pyx_t_4) {
3507  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3508  __PYX_ERR(0, 32, __pyx_L1_error)
3509  }
3510  __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 32, __pyx_L1_error)
3511  __Pyx_GOTREF(__pyx_t_14);
3512  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 32, __pyx_L1_error)
3513  __Pyx_GOTREF(__pyx_t_12);
3514  __pyx_t_7 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_t_4);
3515  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error)
3516  __Pyx_GOTREF(__pyx_t_7);
3517  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3518  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3519  __pyx_t_14 = NULL;
3520  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
3521  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
3522  if (likely(__pyx_t_14)) {
3523  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
3524  __Pyx_INCREF(__pyx_t_14);
3525  __Pyx_INCREF(function);
3526  __Pyx_DECREF_SET(__pyx_t_13, function);
3527  }
3528  }
3529  __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
3530  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3531  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3532  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 32, __pyx_L1_error)
3533  __Pyx_GOTREF(__pyx_t_10);
3534  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3535 
3536  /* "cpartitioning.pyx":25
3537  * nLayersOfOverlap)
3538  * return (
3539  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3540  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3541  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3542  */
3543  __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 25, __pyx_L1_error)
3544  __Pyx_GOTREF(__pyx_t_13);
3545  __Pyx_GIVEREF(__pyx_t_1);
3546  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
3547  __Pyx_GIVEREF(__pyx_t_3);
3548  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
3549  __Pyx_GIVEREF(__pyx_t_5);
3550  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
3551  __Pyx_GIVEREF(__pyx_t_2);
3552  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
3553  __Pyx_GIVEREF(__pyx_t_9);
3554  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
3555  __Pyx_GIVEREF(__pyx_t_8);
3556  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
3557  __Pyx_GIVEREF(__pyx_t_11);
3558  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
3559  __Pyx_GIVEREF(__pyx_t_10);
3560  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
3561  __pyx_t_1 = 0;
3562  __pyx_t_3 = 0;
3563  __pyx_t_5 = 0;
3564  __pyx_t_2 = 0;
3565  __pyx_t_9 = 0;
3566  __pyx_t_8 = 0;
3567  __pyx_t_11 = 0;
3568  __pyx_t_10 = 0;
3569  __pyx_r = __pyx_t_13;
3570  __pyx_t_13 = 0;
3571  goto __pyx_L0;
3572 
3573  /* "cpartitioning.pyx":19
3574  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
3575  *
3576  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3577  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3578  * c_partitionElements(comm.ob_mpi,
3579  */
3580 
3581  /* function exit code */
3582  __pyx_L1_error:;
3583  __Pyx_XDECREF(__pyx_t_1);
3584  __Pyx_XDECREF(__pyx_t_2);
3585  __Pyx_XDECREF(__pyx_t_3);
3586  __Pyx_XDECREF(__pyx_t_5);
3587  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
3588  __Pyx_XDECREF(__pyx_t_8);
3589  __Pyx_XDECREF(__pyx_t_9);
3590  __Pyx_XDECREF(__pyx_t_10);
3591  __Pyx_XDECREF(__pyx_t_11);
3592  __Pyx_XDECREF(__pyx_t_12);
3593  __Pyx_XDECREF(__pyx_t_13);
3594  __Pyx_XDECREF(__pyx_t_14);
3595  __Pyx_AddTraceback("cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3596  __pyx_r = NULL;
3597  __pyx_L0:;
3598  __Pyx_XGIVEREF(__pyx_r);
3599  __Pyx_RefNannyFinishContext();
3600  return __pyx_r;
3601 }
3602 
3603 /* "cpartitioning.pyx":35
3604  * )
3605  *
3606  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3607  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3608  * c_partitionNodes(comm.ob_mpi,
3609  */
3610 
3611 /* Python wrapper */
3612 static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3613 static PyMethodDef __pyx_mdef_13cpartitioning_3partitionNodes = {"partitionNodes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_3partitionNodes, METH_VARARGS|METH_KEYWORDS, 0};
3614 static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3615  struct PyMPICommObject *__pyx_v_comm = 0;
3616  int __pyx_v_nLayersOfOverlap;
3617  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3618  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
3619  int __pyx_lineno = 0;
3620  const char *__pyx_filename = NULL;
3621  int __pyx_clineno = 0;
3622  PyObject *__pyx_r = 0;
3623  __Pyx_RefNannyDeclarations
3624  __Pyx_RefNannySetupContext("partitionNodes (wrapper)", 0);
3625  {
3626  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
3627  PyObject* values[4] = {0,0,0,0};
3628  if (unlikely(__pyx_kwds)) {
3629  Py_ssize_t kw_args;
3630  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3631  switch (pos_args) {
3632  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3633  CYTHON_FALLTHROUGH;
3634  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3635  CYTHON_FALLTHROUGH;
3636  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3637  CYTHON_FALLTHROUGH;
3638  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3639  CYTHON_FALLTHROUGH;
3640  case 0: break;
3641  default: goto __pyx_L5_argtuple_error;
3642  }
3643  kw_args = PyDict_Size(__pyx_kwds);
3644  switch (pos_args) {
3645  case 0:
3646  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
3647  else goto __pyx_L5_argtuple_error;
3648  CYTHON_FALLTHROUGH;
3649  case 1:
3650  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
3651  else {
3652  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 1); __PYX_ERR(0, 35, __pyx_L3_error)
3653  }
3654  CYTHON_FALLTHROUGH;
3655  case 2:
3656  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3657  else {
3658  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 2); __PYX_ERR(0, 35, __pyx_L3_error)
3659  }
3660  CYTHON_FALLTHROUGH;
3661  case 3:
3662  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
3663  else {
3664  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 3); __PYX_ERR(0, 35, __pyx_L3_error)
3665  }
3666  }
3667  if (unlikely(kw_args > 0)) {
3668  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionNodes") < 0)) __PYX_ERR(0, 35, __pyx_L3_error)
3669  }
3670  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3671  goto __pyx_L5_argtuple_error;
3672  } else {
3673  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3674  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3675  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3676  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3677  }
3678  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
3679  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error)
3680  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
3681  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
3682  }
3683  goto __pyx_L4_argument_unpacking_done;
3684  __pyx_L5_argtuple_error:;
3685  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 35, __pyx_L3_error)
3686  __pyx_L3_error:;
3687  __Pyx_AddTraceback("cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
3688  __Pyx_RefNannyFinishContext();
3689  return NULL;
3690  __pyx_L4_argument_unpacking_done:;
3691  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 35, __pyx_L1_error)
3692  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 35, __pyx_L1_error)
3693  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 35, __pyx_L1_error)
3694  __pyx_r = __pyx_pf_13cpartitioning_2partitionNodes(__pyx_self, __pyx_v_comm, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
3695 
3696  /* function exit code */
3697  goto __pyx_L0;
3698  __pyx_L1_error:;
3699  __pyx_r = NULL;
3700  __pyx_L0:;
3701  __Pyx_RefNannyFinishContext();
3702  return __pyx_r;
3703 }
3704 
3705 static PyObject *__pyx_pf_13cpartitioning_2partitionNodes(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
3706  PyObject *__pyx_r = NULL;
3707  __Pyx_RefNannyDeclarations
3708  PyObject *__pyx_t_1 = NULL;
3709  PyObject *__pyx_t_2 = NULL;
3710  PyObject *__pyx_t_3 = NULL;
3711  int *__pyx_t_4;
3712  PyObject *__pyx_t_5 = NULL;
3713  Py_ssize_t __pyx_t_6;
3714  struct __pyx_array_obj *__pyx_t_7 = NULL;
3715  PyObject *__pyx_t_8 = NULL;
3716  PyObject *__pyx_t_9 = NULL;
3717  PyObject *__pyx_t_10 = NULL;
3718  PyObject *__pyx_t_11 = NULL;
3719  PyObject *__pyx_t_12 = NULL;
3720  PyObject *__pyx_t_13 = NULL;
3721  PyObject *__pyx_t_14 = NULL;
3722  int __pyx_lineno = 0;
3723  const char *__pyx_filename = NULL;
3724  int __pyx_clineno = 0;
3725  __Pyx_RefNannySetupContext("partitionNodes", 0);
3726 
3727  /* "cpartitioning.pyx":36
3728  *
3729  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3730  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
3731  * c_partitionNodes(comm.ob_mpi,
3732  * cmesh.mesh,
3733  */
3734  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
3735 
3736  /* "cpartitioning.pyx":37
3737  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3738  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3739  * c_partitionNodes(comm.ob_mpi, # <<<<<<<<<<<<<<
3740  * cmesh.mesh,
3741  * nLayersOfOverlap)
3742  */
3743  (void)(proteus::partitionNodes(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
3744 
3745  /* "cpartitioning.pyx":40
3746  * cmesh.mesh,
3747  * nLayersOfOverlap)
3748  * return ( # <<<<<<<<<<<<<<
3749  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3750  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3751  */
3752  __Pyx_XDECREF(__pyx_r);
3753 
3754  /* "cpartitioning.pyx":41
3755  * nLayersOfOverlap)
3756  * return (
3757  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3758  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3759  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3760  */
3761  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
3762  __Pyx_GOTREF(__pyx_t_2);
3763  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)
3764  __Pyx_GOTREF(__pyx_t_3);
3765  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3766  __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
3767  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
3768  __Pyx_GOTREF(__pyx_t_2);
3769  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error)
3770  __Pyx_GOTREF(__pyx_t_5);
3771  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3772  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L1_error)
3773  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3774  if (!__pyx_t_4) {
3775  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3776  __PYX_ERR(0, 41, __pyx_L1_error)
3777  }
3778  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
3779  __Pyx_GOTREF(__pyx_t_2);
3780  __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error)
3781  __Pyx_GOTREF(__pyx_t_5);
3782  __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(int), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_4);
3783  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 41, __pyx_L1_error)
3784  __Pyx_GOTREF(__pyx_t_7);
3785  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3786  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3787  __pyx_t_2 = NULL;
3788  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3789  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3790  if (likely(__pyx_t_2)) {
3791  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3792  __Pyx_INCREF(__pyx_t_2);
3793  __Pyx_INCREF(function);
3794  __Pyx_DECREF_SET(__pyx_t_3, function);
3795  }
3796  }
3797  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
3798  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3799  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3800  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
3801  __Pyx_GOTREF(__pyx_t_1);
3802  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3803 
3804  /* "cpartitioning.pyx":42
3805  * return (
3806  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3807  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
3808  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3809  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3810  */
3811  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3812  __Pyx_GOTREF(__pyx_t_2);
3813  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
3814  __Pyx_GOTREF(__pyx_t_5);
3815  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3816  __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
3817  if (!__pyx_t_4) {
3818  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3819  __PYX_ERR(0, 42, __pyx_L1_error)
3820  }
3821  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 42, __pyx_L1_error)
3822  __Pyx_GOTREF(__pyx_t_8);
3823  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3824  __Pyx_GOTREF(__pyx_t_2);
3825  __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3826  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error)
3827  __Pyx_GOTREF(__pyx_t_7);
3828  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3829  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3830  __pyx_t_8 = NULL;
3831  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3832  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
3833  if (likely(__pyx_t_8)) {
3834  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3835  __Pyx_INCREF(__pyx_t_8);
3836  __Pyx_INCREF(function);
3837  __Pyx_DECREF_SET(__pyx_t_5, function);
3838  }
3839  }
3840  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
3841  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3842  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3843  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
3844  __Pyx_GOTREF(__pyx_t_3);
3845  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3846 
3847  /* "cpartitioning.pyx":43
3848  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3849  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3850  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3851  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3852  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3853  */
3854  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error)
3855  __Pyx_GOTREF(__pyx_t_8);
3856  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
3857  __Pyx_GOTREF(__pyx_t_2);
3858  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3859  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
3860  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error)
3861  __Pyx_GOTREF(__pyx_t_8);
3862  __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 43, __pyx_L1_error)
3863  __Pyx_GOTREF(__pyx_t_9);
3864  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3865  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L1_error)
3866  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3867  if (!__pyx_t_4) {
3868  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3869  __PYX_ERR(0, 43, __pyx_L1_error)
3870  }
3871  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error)
3872  __Pyx_GOTREF(__pyx_t_8);
3873  __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 43, __pyx_L1_error)
3874  __Pyx_GOTREF(__pyx_t_9);
3875  __pyx_t_7 = __pyx_array_new(__pyx_t_9, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3876  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error)
3877  __Pyx_GOTREF(__pyx_t_7);
3878  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3879  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3880  __pyx_t_8 = NULL;
3881  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3882  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
3883  if (likely(__pyx_t_8)) {
3884  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3885  __Pyx_INCREF(__pyx_t_8);
3886  __Pyx_INCREF(function);
3887  __Pyx_DECREF_SET(__pyx_t_2, function);
3888  }
3889  }
3890  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
3891  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3892  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3893  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 43, __pyx_L1_error)
3894  __Pyx_GOTREF(__pyx_t_5);
3895  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3896 
3897  /* "cpartitioning.pyx":44
3898  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3899  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3900  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
3901  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3902  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3903  */
3904  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
3905  __Pyx_GOTREF(__pyx_t_8);
3906  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error)
3907  __Pyx_GOTREF(__pyx_t_9);
3908  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3909  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
3910  if (!__pyx_t_4) {
3911  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3912  __PYX_ERR(0, 44, __pyx_L1_error)
3913  }
3914  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 44, __pyx_L1_error)
3915  __Pyx_GOTREF(__pyx_t_10);
3916  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
3917  __Pyx_GOTREF(__pyx_t_8);
3918  __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3919  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 44, __pyx_L1_error)
3920  __Pyx_GOTREF(__pyx_t_7);
3921  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3922  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3923  __pyx_t_10 = NULL;
3924  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
3925  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
3926  if (likely(__pyx_t_10)) {
3927  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
3928  __Pyx_INCREF(__pyx_t_10);
3929  __Pyx_INCREF(function);
3930  __Pyx_DECREF_SET(__pyx_t_9, function);
3931  }
3932  }
3933  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
3934  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3935  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3936  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
3937  __Pyx_GOTREF(__pyx_t_2);
3938  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3939 
3940  /* "cpartitioning.pyx":45
3941  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3942  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3943  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3944  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3945  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
3946  */
3947  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 45, __pyx_L1_error)
3948  __Pyx_GOTREF(__pyx_t_10);
3949  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error)
3950  __Pyx_GOTREF(__pyx_t_8);
3951  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3952  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
3953  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 45, __pyx_L1_error)
3954  __Pyx_GOTREF(__pyx_t_10);
3955  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 45, __pyx_L1_error)
3956  __Pyx_GOTREF(__pyx_t_11);
3957  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3958  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error)
3959  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3960  if (!__pyx_t_4) {
3961  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3962  __PYX_ERR(0, 45, __pyx_L1_error)
3963  }
3964  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 45, __pyx_L1_error)
3965  __Pyx_GOTREF(__pyx_t_10);
3966  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 45, __pyx_L1_error)
3967  __Pyx_GOTREF(__pyx_t_11);
3968  __pyx_t_7 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3969  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error)
3970  __Pyx_GOTREF(__pyx_t_7);
3971  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3972  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3973  __pyx_t_10 = NULL;
3974  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
3975  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
3976  if (likely(__pyx_t_10)) {
3977  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
3978  __Pyx_INCREF(__pyx_t_10);
3979  __Pyx_INCREF(function);
3980  __Pyx_DECREF_SET(__pyx_t_8, function);
3981  }
3982  }
3983  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
3984  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3985  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3986  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 45, __pyx_L1_error)
3987  __Pyx_GOTREF(__pyx_t_9);
3988  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3989 
3990  /* "cpartitioning.pyx":46
3991  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3992  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3993  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
3994  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
3995  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
3996  */
3997  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
3998  __Pyx_GOTREF(__pyx_t_10);
3999  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 46, __pyx_L1_error)
4000  __Pyx_GOTREF(__pyx_t_11);
4001  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4002  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
4003  if (!__pyx_t_4) {
4004  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4005  __PYX_ERR(0, 46, __pyx_L1_error)
4006  }
4007  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 46, __pyx_L1_error)
4008  __Pyx_GOTREF(__pyx_t_12);
4009  __pyx_t_10 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
4010  __Pyx_GOTREF(__pyx_t_10);
4011  __pyx_t_7 = __pyx_array_new(__pyx_t_10, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4012  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L1_error)
4013  __Pyx_GOTREF(__pyx_t_7);
4014  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4015  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4016  __pyx_t_12 = NULL;
4017  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
4018  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
4019  if (likely(__pyx_t_12)) {
4020  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
4021  __Pyx_INCREF(__pyx_t_12);
4022  __Pyx_INCREF(function);
4023  __Pyx_DECREF_SET(__pyx_t_11, function);
4024  }
4025  }
4026  __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
4027  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4028  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4029  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L1_error)
4030  __Pyx_GOTREF(__pyx_t_8);
4031  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4032 
4033  /* "cpartitioning.pyx":47
4034  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4035  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4036  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4037  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4038  * )
4039  */
4040  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 47, __pyx_L1_error)
4041  __Pyx_GOTREF(__pyx_t_12);
4042  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 47, __pyx_L1_error)
4043  __Pyx_GOTREF(__pyx_t_10);
4044  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4045  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
4046  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 47, __pyx_L1_error)
4047  __Pyx_GOTREF(__pyx_t_12);
4048  __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 47, __pyx_L1_error)
4049  __Pyx_GOTREF(__pyx_t_13);
4050  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4051  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L1_error)
4052  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4053  if (!__pyx_t_4) {
4054  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4055  __PYX_ERR(0, 47, __pyx_L1_error)
4056  }
4057  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 47, __pyx_L1_error)
4058  __Pyx_GOTREF(__pyx_t_12);
4059  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 47, __pyx_L1_error)
4060  __Pyx_GOTREF(__pyx_t_13);
4061  __pyx_t_7 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4062  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L1_error)
4063  __Pyx_GOTREF(__pyx_t_7);
4064  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4065  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4066  __pyx_t_12 = NULL;
4067  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
4068  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
4069  if (likely(__pyx_t_12)) {
4070  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
4071  __Pyx_INCREF(__pyx_t_12);
4072  __Pyx_INCREF(function);
4073  __Pyx_DECREF_SET(__pyx_t_10, function);
4074  }
4075  }
4076  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
4077  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4078  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4079  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 47, __pyx_L1_error)
4080  __Pyx_GOTREF(__pyx_t_11);
4081  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4082 
4083  /* "cpartitioning.pyx":48
4084  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4085  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4086  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
4087  * )
4088  *
4089  */
4090  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error)
4091  __Pyx_GOTREF(__pyx_t_12);
4092  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 48, __pyx_L1_error)
4093  __Pyx_GOTREF(__pyx_t_13);
4094  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4095  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
4096  if (!__pyx_t_4) {
4097  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4098  __PYX_ERR(0, 48, __pyx_L1_error)
4099  }
4100  __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 48, __pyx_L1_error)
4101  __Pyx_GOTREF(__pyx_t_14);
4102  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error)
4103  __Pyx_GOTREF(__pyx_t_12);
4104  __pyx_t_7 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_t_4);
4105  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 48, __pyx_L1_error)
4106  __Pyx_GOTREF(__pyx_t_7);
4107  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4108  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4109  __pyx_t_14 = NULL;
4110  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
4111  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
4112  if (likely(__pyx_t_14)) {
4113  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
4114  __Pyx_INCREF(__pyx_t_14);
4115  __Pyx_INCREF(function);
4116  __Pyx_DECREF_SET(__pyx_t_13, function);
4117  }
4118  }
4119  __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
4120  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4121  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4122  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 48, __pyx_L1_error)
4123  __Pyx_GOTREF(__pyx_t_10);
4124  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4125 
4126  /* "cpartitioning.pyx":41
4127  * nLayersOfOverlap)
4128  * return (
4129  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4130  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4131  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4132  */
4133  __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 41, __pyx_L1_error)
4134  __Pyx_GOTREF(__pyx_t_13);
4135  __Pyx_GIVEREF(__pyx_t_1);
4136  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
4137  __Pyx_GIVEREF(__pyx_t_3);
4138  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
4139  __Pyx_GIVEREF(__pyx_t_5);
4140  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
4141  __Pyx_GIVEREF(__pyx_t_2);
4142  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
4143  __Pyx_GIVEREF(__pyx_t_9);
4144  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
4145  __Pyx_GIVEREF(__pyx_t_8);
4146  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
4147  __Pyx_GIVEREF(__pyx_t_11);
4148  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
4149  __Pyx_GIVEREF(__pyx_t_10);
4150  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
4151  __pyx_t_1 = 0;
4152  __pyx_t_3 = 0;
4153  __pyx_t_5 = 0;
4154  __pyx_t_2 = 0;
4155  __pyx_t_9 = 0;
4156  __pyx_t_8 = 0;
4157  __pyx_t_11 = 0;
4158  __pyx_t_10 = 0;
4159  __pyx_r = __pyx_t_13;
4160  __pyx_t_13 = 0;
4161  goto __pyx_L0;
4162 
4163  /* "cpartitioning.pyx":35
4164  * )
4165  *
4166  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4167  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4168  * c_partitionNodes(comm.ob_mpi,
4169  */
4170 
4171  /* function exit code */
4172  __pyx_L1_error:;
4173  __Pyx_XDECREF(__pyx_t_1);
4174  __Pyx_XDECREF(__pyx_t_2);
4175  __Pyx_XDECREF(__pyx_t_3);
4176  __Pyx_XDECREF(__pyx_t_5);
4177  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
4178  __Pyx_XDECREF(__pyx_t_8);
4179  __Pyx_XDECREF(__pyx_t_9);
4180  __Pyx_XDECREF(__pyx_t_10);
4181  __Pyx_XDECREF(__pyx_t_11);
4182  __Pyx_XDECREF(__pyx_t_12);
4183  __Pyx_XDECREF(__pyx_t_13);
4184  __Pyx_XDECREF(__pyx_t_14);
4185  __Pyx_AddTraceback("cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
4186  __pyx_r = NULL;
4187  __pyx_L0:;
4188  __Pyx_XGIVEREF(__pyx_r);
4189  __Pyx_RefNannyFinishContext();
4190  return __pyx_r;
4191 }
4192 
4193 /* "cpartitioning.pyx":51
4194  * )
4195  *
4196  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4197  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4198  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4199  */
4200 
4201 /* Python wrapper */
4202 static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4203 static PyMethodDef __pyx_mdef_13cpartitioning_5convertPUMIPartitionToPython = {"convertPUMIPartitionToPython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython, METH_VARARGS|METH_KEYWORDS, 0};
4204 static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4205  CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm = 0;
4206  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
4207  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
4208  int __pyx_lineno = 0;
4209  const char *__pyx_filename = NULL;
4210  int __pyx_clineno = 0;
4211  PyObject *__pyx_r = 0;
4212  __Pyx_RefNannyDeclarations
4213  __Pyx_RefNannySetupContext("convertPUMIPartitionToPython (wrapper)", 0);
4214  {
4215  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
4216  PyObject* values[3] = {0,0,0};
4217  if (unlikely(__pyx_kwds)) {
4218  Py_ssize_t kw_args;
4219  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4220  switch (pos_args) {
4221  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4222  CYTHON_FALLTHROUGH;
4223  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4224  CYTHON_FALLTHROUGH;
4225  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4226  CYTHON_FALLTHROUGH;
4227  case 0: break;
4228  default: goto __pyx_L5_argtuple_error;
4229  }
4230  kw_args = PyDict_Size(__pyx_kwds);
4231  switch (pos_args) {
4232  case 0:
4233  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
4234  else goto __pyx_L5_argtuple_error;
4235  CYTHON_FALLTHROUGH;
4236  case 1:
4237  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4238  else {
4239  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, 1); __PYX_ERR(0, 51, __pyx_L3_error)
4240  }
4241  CYTHON_FALLTHROUGH;
4242  case 2:
4243  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4244  else {
4245  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, 2); __PYX_ERR(0, 51, __pyx_L3_error)
4246  }
4247  }
4248  if (unlikely(kw_args > 0)) {
4249  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convertPUMIPartitionToPython") < 0)) __PYX_ERR(0, 51, __pyx_L3_error)
4250  }
4251  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4252  goto __pyx_L5_argtuple_error;
4253  } else {
4254  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4255  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4256  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4257  }
4258  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
4259  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[1]);
4260  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
4261  }
4262  goto __pyx_L4_argument_unpacking_done;
4263  __pyx_L5_argtuple_error:;
4264  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 51, __pyx_L3_error)
4265  __pyx_L3_error:;
4266  __Pyx_AddTraceback("cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4267  __Pyx_RefNannyFinishContext();
4268  return NULL;
4269  __pyx_L4_argument_unpacking_done:;
4270  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 51, __pyx_L1_error)
4271  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 51, __pyx_L1_error)
4272  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 51, __pyx_L1_error)
4273  __pyx_r = __pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(__pyx_self, __pyx_v_comm, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
4274 
4275  /* function exit code */
4276  goto __pyx_L0;
4277  __pyx_L1_error:;
4278  __pyx_r = NULL;
4279  __pyx_L0:;
4280  __Pyx_RefNannyFinishContext();
4281  return __pyx_r;
4282 }
4283 
4284 static PyObject *__pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
4285  PyObject *__pyx_r = NULL;
4286  __Pyx_RefNannyDeclarations
4287  PyObject *__pyx_t_1 = NULL;
4288  PyObject *__pyx_t_2 = NULL;
4289  PyObject *__pyx_t_3 = NULL;
4290  int *__pyx_t_4;
4291  PyObject *__pyx_t_5 = NULL;
4292  Py_ssize_t __pyx_t_6;
4293  struct __pyx_array_obj *__pyx_t_7 = NULL;
4294  PyObject *__pyx_t_8 = NULL;
4295  PyObject *__pyx_t_9 = NULL;
4296  PyObject *__pyx_t_10 = NULL;
4297  PyObject *__pyx_t_11 = NULL;
4298  PyObject *__pyx_t_12 = NULL;
4299  PyObject *__pyx_t_13 = NULL;
4300  PyObject *__pyx_t_14 = NULL;
4301  int __pyx_lineno = 0;
4302  const char *__pyx_filename = NULL;
4303  int __pyx_clineno = 0;
4304  __Pyx_RefNannySetupContext("convertPUMIPartitionToPython", 0);
4305 
4306  /* "cpartitioning.pyx":53
4307  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4308  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4309  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
4310  * return (
4311  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4312  */
4313  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
4314 
4315  /* "cpartitioning.pyx":54
4316  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4317  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4318  * return ( # <<<<<<<<<<<<<<
4319  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4320  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4321  */
4322  __Pyx_XDECREF(__pyx_r);
4323 
4324  /* "cpartitioning.pyx":55
4325  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4326  * return (
4327  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4328  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4329  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4330  */
4331  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
4332  __Pyx_GOTREF(__pyx_t_2);
4333  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)
4334  __Pyx_GOTREF(__pyx_t_3);
4335  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4336  __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
4337  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
4338  __Pyx_GOTREF(__pyx_t_2);
4339  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 55, __pyx_L1_error)
4340  __Pyx_GOTREF(__pyx_t_5);
4341  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4342  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error)
4343  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4344  if (!__pyx_t_4) {
4345  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4346  __PYX_ERR(0, 55, __pyx_L1_error)
4347  }
4348  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
4349  __Pyx_GOTREF(__pyx_t_2);
4350  __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 55, __pyx_L1_error)
4351  __Pyx_GOTREF(__pyx_t_5);
4352  __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(int), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_4);
4353  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 55, __pyx_L1_error)
4354  __Pyx_GOTREF(__pyx_t_7);
4355  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4356  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4357  __pyx_t_2 = NULL;
4358  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4359  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4360  if (likely(__pyx_t_2)) {
4361  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4362  __Pyx_INCREF(__pyx_t_2);
4363  __Pyx_INCREF(function);
4364  __Pyx_DECREF_SET(__pyx_t_3, function);
4365  }
4366  }
4367  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
4368  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4369  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4370  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
4371  __Pyx_GOTREF(__pyx_t_1);
4372  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4373 
4374  /* "cpartitioning.pyx":56
4375  * return (
4376  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4377  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
4378  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4379  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4380  */
4381  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
4382  __Pyx_GOTREF(__pyx_t_2);
4383  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
4384  __Pyx_GOTREF(__pyx_t_5);
4385  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4386  __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
4387  if (!__pyx_t_4) {
4388  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4389  __PYX_ERR(0, 56, __pyx_L1_error)
4390  }
4391  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L1_error)
4392  __Pyx_GOTREF(__pyx_t_8);
4393  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
4394  __Pyx_GOTREF(__pyx_t_2);
4395  __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
4396  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L1_error)
4397  __Pyx_GOTREF(__pyx_t_7);
4398  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4399  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4400  __pyx_t_8 = NULL;
4401  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
4402  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
4403  if (likely(__pyx_t_8)) {
4404  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
4405  __Pyx_INCREF(__pyx_t_8);
4406  __Pyx_INCREF(function);
4407  __Pyx_DECREF_SET(__pyx_t_5, function);
4408  }
4409  }
4410  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
4411  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4412  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4413  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
4414  __Pyx_GOTREF(__pyx_t_3);
4415  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4416 
4417  /* "cpartitioning.pyx":57
4418  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4419  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4420  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4421  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4422  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4423  */
4424  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 57, __pyx_L1_error)
4425  __Pyx_GOTREF(__pyx_t_8);
4426  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
4427  __Pyx_GOTREF(__pyx_t_2);
4428  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4429  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
4430  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 57, __pyx_L1_error)
4431  __Pyx_GOTREF(__pyx_t_8);
4432  __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 57, __pyx_L1_error)
4433  __Pyx_GOTREF(__pyx_t_9);
4434  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4435  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
4436  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4437  if (!__pyx_t_4) {
4438  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4439  __PYX_ERR(0, 57, __pyx_L1_error)
4440  }
4441  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 57, __pyx_L1_error)
4442  __Pyx_GOTREF(__pyx_t_8);
4443  __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 57, __pyx_L1_error)
4444  __Pyx_GOTREF(__pyx_t_9);
4445  __pyx_t_7 = __pyx_array_new(__pyx_t_9, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
4446  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L1_error)
4447  __Pyx_GOTREF(__pyx_t_7);
4448  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4449  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4450  __pyx_t_8 = NULL;
4451  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4452  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
4453  if (likely(__pyx_t_8)) {
4454  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4455  __Pyx_INCREF(__pyx_t_8);
4456  __Pyx_INCREF(function);
4457  __Pyx_DECREF_SET(__pyx_t_2, function);
4458  }
4459  }
4460  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
4461  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4462  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4463  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
4464  __Pyx_GOTREF(__pyx_t_5);
4465  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4466 
4467  /* "cpartitioning.pyx":58
4468  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4469  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4470  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
4471  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4472  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4473  */
4474  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
4475  __Pyx_GOTREF(__pyx_t_8);
4476  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 58, __pyx_L1_error)
4477  __Pyx_GOTREF(__pyx_t_9);
4478  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4479  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
4480  if (!__pyx_t_4) {
4481  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4482  __PYX_ERR(0, 58, __pyx_L1_error)
4483  }
4484  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 58, __pyx_L1_error)
4485  __Pyx_GOTREF(__pyx_t_10);
4486  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
4487  __Pyx_GOTREF(__pyx_t_8);
4488  __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
4489  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 58, __pyx_L1_error)
4490  __Pyx_GOTREF(__pyx_t_7);
4491  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4492  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4493  __pyx_t_10 = NULL;
4494  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
4495  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
4496  if (likely(__pyx_t_10)) {
4497  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
4498  __Pyx_INCREF(__pyx_t_10);
4499  __Pyx_INCREF(function);
4500  __Pyx_DECREF_SET(__pyx_t_9, function);
4501  }
4502  }
4503  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
4504  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4505  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4506  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
4507  __Pyx_GOTREF(__pyx_t_2);
4508  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4509 
4510  /* "cpartitioning.pyx":59
4511  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4512  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4513  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4514  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4515  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4516  */
4517  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L1_error)
4518  __Pyx_GOTREF(__pyx_t_10);
4519  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error)
4520  __Pyx_GOTREF(__pyx_t_8);
4521  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4522  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
4523  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L1_error)
4524  __Pyx_GOTREF(__pyx_t_10);
4525  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L1_error)
4526  __Pyx_GOTREF(__pyx_t_11);
4527  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4528  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error)
4529  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4530  if (!__pyx_t_4) {
4531  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4532  __PYX_ERR(0, 59, __pyx_L1_error)
4533  }
4534  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L1_error)
4535  __Pyx_GOTREF(__pyx_t_10);
4536  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L1_error)
4537  __Pyx_GOTREF(__pyx_t_11);
4538  __pyx_t_7 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
4539  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 59, __pyx_L1_error)
4540  __Pyx_GOTREF(__pyx_t_7);
4541  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4542  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4543  __pyx_t_10 = NULL;
4544  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
4545  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
4546  if (likely(__pyx_t_10)) {
4547  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
4548  __Pyx_INCREF(__pyx_t_10);
4549  __Pyx_INCREF(function);
4550  __Pyx_DECREF_SET(__pyx_t_8, function);
4551  }
4552  }
4553  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
4554  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4555  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4556  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 59, __pyx_L1_error)
4557  __Pyx_GOTREF(__pyx_t_9);
4558  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4559 
4560  /* "cpartitioning.pyx":60
4561  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4562  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4563  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
4564  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4565  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4566  */
4567  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
4568  __Pyx_GOTREF(__pyx_t_10);
4569  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L1_error)
4570  __Pyx_GOTREF(__pyx_t_11);
4571  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4572  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
4573  if (!__pyx_t_4) {
4574  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4575  __PYX_ERR(0, 60, __pyx_L1_error)
4576  }
4577  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 60, __pyx_L1_error)
4578  __Pyx_GOTREF(__pyx_t_12);
4579  __pyx_t_10 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
4580  __Pyx_GOTREF(__pyx_t_10);
4581  __pyx_t_7 = __pyx_array_new(__pyx_t_10, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4582  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error)
4583  __Pyx_GOTREF(__pyx_t_7);
4584  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4585  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4586  __pyx_t_12 = NULL;
4587  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
4588  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
4589  if (likely(__pyx_t_12)) {
4590  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
4591  __Pyx_INCREF(__pyx_t_12);
4592  __Pyx_INCREF(function);
4593  __Pyx_DECREF_SET(__pyx_t_11, function);
4594  }
4595  }
4596  __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
4597  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4598  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4599  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L1_error)
4600  __Pyx_GOTREF(__pyx_t_8);
4601  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4602 
4603  /* "cpartitioning.pyx":61
4604  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4605  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4606  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4607  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4608  * )
4609  */
4610  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 61, __pyx_L1_error)
4611  __Pyx_GOTREF(__pyx_t_12);
4612  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error)
4613  __Pyx_GOTREF(__pyx_t_10);
4614  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4615  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
4616  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 61, __pyx_L1_error)
4617  __Pyx_GOTREF(__pyx_t_12);
4618  __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 61, __pyx_L1_error)
4619  __Pyx_GOTREF(__pyx_t_13);
4620  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4621  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
4622  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4623  if (!__pyx_t_4) {
4624  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4625  __PYX_ERR(0, 61, __pyx_L1_error)
4626  }
4627  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 61, __pyx_L1_error)
4628  __Pyx_GOTREF(__pyx_t_12);
4629  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 61, __pyx_L1_error)
4630  __Pyx_GOTREF(__pyx_t_13);
4631  __pyx_t_7 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4632  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error)
4633  __Pyx_GOTREF(__pyx_t_7);
4634  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4635  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4636  __pyx_t_12 = NULL;
4637  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
4638  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
4639  if (likely(__pyx_t_12)) {
4640  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
4641  __Pyx_INCREF(__pyx_t_12);
4642  __Pyx_INCREF(function);
4643  __Pyx_DECREF_SET(__pyx_t_10, function);
4644  }
4645  }
4646  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
4647  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4648  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4649  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 61, __pyx_L1_error)
4650  __Pyx_GOTREF(__pyx_t_11);
4651  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4652 
4653  /* "cpartitioning.pyx":62
4654  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4655  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4656  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
4657  * )
4658  *
4659  */
4660  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
4661  __Pyx_GOTREF(__pyx_t_12);
4662  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error)
4663  __Pyx_GOTREF(__pyx_t_13);
4664  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4665  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
4666  if (!__pyx_t_4) {
4667  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4668  __PYX_ERR(0, 62, __pyx_L1_error)
4669  }
4670  __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 62, __pyx_L1_error)
4671  __Pyx_GOTREF(__pyx_t_14);
4672  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
4673  __Pyx_GOTREF(__pyx_t_12);
4674  __pyx_t_7 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_t_4);
4675  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 62, __pyx_L1_error)
4676  __Pyx_GOTREF(__pyx_t_7);
4677  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4678  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4679  __pyx_t_14 = NULL;
4680  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
4681  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
4682  if (likely(__pyx_t_14)) {
4683  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
4684  __Pyx_INCREF(__pyx_t_14);
4685  __Pyx_INCREF(function);
4686  __Pyx_DECREF_SET(__pyx_t_13, function);
4687  }
4688  }
4689  __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
4690  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4691  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4692  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 62, __pyx_L1_error)
4693  __Pyx_GOTREF(__pyx_t_10);
4694  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4695 
4696  /* "cpartitioning.pyx":55
4697  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4698  * return (
4699  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4700  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4701  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4702  */
4703  __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 55, __pyx_L1_error)
4704  __Pyx_GOTREF(__pyx_t_13);
4705  __Pyx_GIVEREF(__pyx_t_1);
4706  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
4707  __Pyx_GIVEREF(__pyx_t_3);
4708  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
4709  __Pyx_GIVEREF(__pyx_t_5);
4710  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
4711  __Pyx_GIVEREF(__pyx_t_2);
4712  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
4713  __Pyx_GIVEREF(__pyx_t_9);
4714  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
4715  __Pyx_GIVEREF(__pyx_t_8);
4716  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
4717  __Pyx_GIVEREF(__pyx_t_11);
4718  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
4719  __Pyx_GIVEREF(__pyx_t_10);
4720  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
4721  __pyx_t_1 = 0;
4722  __pyx_t_3 = 0;
4723  __pyx_t_5 = 0;
4724  __pyx_t_2 = 0;
4725  __pyx_t_9 = 0;
4726  __pyx_t_8 = 0;
4727  __pyx_t_11 = 0;
4728  __pyx_t_10 = 0;
4729  __pyx_r = __pyx_t_13;
4730  __pyx_t_13 = 0;
4731  goto __pyx_L0;
4732 
4733  /* "cpartitioning.pyx":51
4734  * )
4735  *
4736  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4737  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4738  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4739  */
4740 
4741  /* function exit code */
4742  __pyx_L1_error:;
4743  __Pyx_XDECREF(__pyx_t_1);
4744  __Pyx_XDECREF(__pyx_t_2);
4745  __Pyx_XDECREF(__pyx_t_3);
4746  __Pyx_XDECREF(__pyx_t_5);
4747  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
4748  __Pyx_XDECREF(__pyx_t_8);
4749  __Pyx_XDECREF(__pyx_t_9);
4750  __Pyx_XDECREF(__pyx_t_10);
4751  __Pyx_XDECREF(__pyx_t_11);
4752  __Pyx_XDECREF(__pyx_t_12);
4753  __Pyx_XDECREF(__pyx_t_13);
4754  __Pyx_XDECREF(__pyx_t_14);
4755  __Pyx_AddTraceback("cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4756  __pyx_r = NULL;
4757  __pyx_L0:;
4758  __Pyx_XGIVEREF(__pyx_r);
4759  __Pyx_RefNannyFinishContext();
4760  return __pyx_r;
4761 }
4762 
4763 /* "cpartitioning.pyx":65
4764  * )
4765  *
4766  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4767  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4768  * if not isinstance(filebase, bytes):
4769  */
4770 
4771 /* Python wrapper */
4772 static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4773 static PyMethodDef __pyx_mdef_13cpartitioning_7partitionNodesFromTetgenFiles = {"partitionNodesFromTetgenFiles", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles, METH_VARARGS|METH_KEYWORDS, 0};
4774 static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4775  struct PyMPICommObject *__pyx_v_comm = 0;
4776  PyObject *__pyx_v_filebase = 0;
4777  int __pyx_v_indexBase;
4778  int __pyx_v_nLayersOfOverlap;
4779  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
4780  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
4781  int __pyx_lineno = 0;
4782  const char *__pyx_filename = NULL;
4783  int __pyx_clineno = 0;
4784  PyObject *__pyx_r = 0;
4785  __Pyx_RefNannyDeclarations
4786  __Pyx_RefNannySetupContext("partitionNodesFromTetgenFiles (wrapper)", 0);
4787  {
4788  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_filebase,&__pyx_n_s_indexBase,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
4789  PyObject* values[6] = {0,0,0,0,0,0};
4790  if (unlikely(__pyx_kwds)) {
4791  Py_ssize_t kw_args;
4792  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4793  switch (pos_args) {
4794  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4795  CYTHON_FALLTHROUGH;
4796  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4797  CYTHON_FALLTHROUGH;
4798  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4799  CYTHON_FALLTHROUGH;
4800  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4801  CYTHON_FALLTHROUGH;
4802  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4803  CYTHON_FALLTHROUGH;
4804  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4805  CYTHON_FALLTHROUGH;
4806  case 0: break;
4807  default: goto __pyx_L5_argtuple_error;
4808  }
4809  kw_args = PyDict_Size(__pyx_kwds);
4810  switch (pos_args) {
4811  case 0:
4812  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
4813  else goto __pyx_L5_argtuple_error;
4814  CYTHON_FALLTHROUGH;
4815  case 1:
4816  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filebase)) != 0)) kw_args--;
4817  else {
4818  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 1); __PYX_ERR(0, 65, __pyx_L3_error)
4819  }
4820  CYTHON_FALLTHROUGH;
4821  case 2:
4822  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indexBase)) != 0)) kw_args--;
4823  else {
4824  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 2); __PYX_ERR(0, 65, __pyx_L3_error)
4825  }
4826  CYTHON_FALLTHROUGH;
4827  case 3:
4828  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
4829  else {
4830  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 3); __PYX_ERR(0, 65, __pyx_L3_error)
4831  }
4832  CYTHON_FALLTHROUGH;
4833  case 4:
4834  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4835  else {
4836  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 4); __PYX_ERR(0, 65, __pyx_L3_error)
4837  }
4838  CYTHON_FALLTHROUGH;
4839  case 5:
4840  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4841  else {
4842  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 5); __PYX_ERR(0, 65, __pyx_L3_error)
4843  }
4844  }
4845  if (unlikely(kw_args > 0)) {
4846  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionNodesFromTetgenFiles") < 0)) __PYX_ERR(0, 65, __pyx_L3_error)
4847  }
4848  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4849  goto __pyx_L5_argtuple_error;
4850  } else {
4851  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4852  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4853  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4854  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4855  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4856  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4857  }
4858  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
4859  __pyx_v_filebase = values[1];
4860  __pyx_v_indexBase = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_indexBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error)
4861  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error)
4862  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[4]);
4863  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[5]);
4864  }
4865  goto __pyx_L4_argument_unpacking_done;
4866  __pyx_L5_argtuple_error:;
4867  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 65, __pyx_L3_error)
4868  __pyx_L3_error:;
4869  __Pyx_AddTraceback("cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
4870  __Pyx_RefNannyFinishContext();
4871  return NULL;
4872  __pyx_L4_argument_unpacking_done:;
4873  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 65, __pyx_L1_error)
4874  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 65, __pyx_L1_error)
4875  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 65, __pyx_L1_error)
4876  __pyx_r = __pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(__pyx_self, __pyx_v_comm, __pyx_v_filebase, __pyx_v_indexBase, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
4877 
4878  /* function exit code */
4879  goto __pyx_L0;
4880  __pyx_L1_error:;
4881  __pyx_r = NULL;
4882  __pyx_L0:;
4883  __Pyx_RefNannyFinishContext();
4884  return __pyx_r;
4885 }
4886 
4887 static PyObject *__pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
4888  PyObject *__pyx_r = NULL;
4889  __Pyx_RefNannyDeclarations
4890  int __pyx_t_1;
4891  int __pyx_t_2;
4892  PyObject *__pyx_t_3 = NULL;
4893  PyObject *__pyx_t_4 = NULL;
4894  PyObject *__pyx_t_5 = NULL;
4895  char *__pyx_t_6;
4896  int *__pyx_t_7;
4897  PyObject *__pyx_t_8 = NULL;
4898  Py_ssize_t __pyx_t_9;
4899  struct __pyx_array_obj *__pyx_t_10 = NULL;
4900  PyObject *__pyx_t_11 = NULL;
4901  PyObject *__pyx_t_12 = NULL;
4902  PyObject *__pyx_t_13 = NULL;
4903  PyObject *__pyx_t_14 = NULL;
4904  PyObject *__pyx_t_15 = NULL;
4905  PyObject *__pyx_t_16 = NULL;
4906  PyObject *__pyx_t_17 = NULL;
4907  int __pyx_lineno = 0;
4908  const char *__pyx_filename = NULL;
4909  int __pyx_clineno = 0;
4910  __Pyx_RefNannySetupContext("partitionNodesFromTetgenFiles", 0);
4911  __Pyx_INCREF(__pyx_v_filebase);
4912 
4913  /* "cpartitioning.pyx":66
4914  *
4915  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4916  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
4917  * if not isinstance(filebase, bytes):
4918  * filebase = filebase.encode()
4919  */
4920  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
4921 
4922  /* "cpartitioning.pyx":67
4923  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4924  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4925  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
4926  * filebase = filebase.encode()
4927  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
4928  */
4929  __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
4930  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
4931  if (__pyx_t_2) {
4932 
4933  /* "cpartitioning.pyx":68
4934  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4935  * if not isinstance(filebase, bytes):
4936  * filebase = filebase.encode() # <<<<<<<<<<<<<<
4937  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
4938  * <const char*>(<char*>filebase),
4939  */
4940  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filebase, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error)
4941  __Pyx_GOTREF(__pyx_t_4);
4942  __pyx_t_5 = NULL;
4943  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
4944  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
4945  if (likely(__pyx_t_5)) {
4946  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4947  __Pyx_INCREF(__pyx_t_5);
4948  __Pyx_INCREF(function);
4949  __Pyx_DECREF_SET(__pyx_t_4, function);
4950  }
4951  }
4952  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
4953  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4954  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error)
4955  __Pyx_GOTREF(__pyx_t_3);
4956  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4957  __Pyx_DECREF_SET(__pyx_v_filebase, __pyx_t_3);
4958  __pyx_t_3 = 0;
4959 
4960  /* "cpartitioning.pyx":67
4961  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4962  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4963  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
4964  * filebase = filebase.encode()
4965  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
4966  */
4967  }
4968 
4969  /* "cpartitioning.pyx":70
4970  * filebase = filebase.encode()
4971  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
4972  * <const char*>(<char*>filebase), # <<<<<<<<<<<<<<
4973  * indexBase,
4974  * cmesh.mesh,
4975  */
4976  __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L1_error)
4977 
4978  /* "cpartitioning.pyx":69
4979  * if not isinstance(filebase, bytes):
4980  * filebase = filebase.encode()
4981  * c_partitionNodesFromTetgenFiles(comm.ob_mpi, # <<<<<<<<<<<<<<
4982  * <const char*>(<char*>filebase),
4983  * indexBase,
4984  */
4985  (void)(proteus::partitionNodesFromTetgenFiles(__pyx_v_comm->ob_mpi, ((char const *)((char *)__pyx_t_6)), __pyx_v_indexBase, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
4986 
4987  /* "cpartitioning.pyx":74
4988  * cmesh.mesh,
4989  * nLayersOfOverlap)
4990  * return ( # <<<<<<<<<<<<<<
4991  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4992  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4993  */
4994  __Pyx_XDECREF(__pyx_r);
4995 
4996  /* "cpartitioning.pyx":75
4997  * nLayersOfOverlap)
4998  * return (
4999  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5000  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5001  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5002  */
5003  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
5004  __Pyx_GOTREF(__pyx_t_4);
5005  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
5006  __Pyx_GOTREF(__pyx_t_5);
5007  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5008  __pyx_t_7 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
5009  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
5010  __Pyx_GOTREF(__pyx_t_4);
5011  __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 75, __pyx_L1_error)
5012  __Pyx_GOTREF(__pyx_t_8);
5013  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5014  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L1_error)
5015  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5016  if (!__pyx_t_7) {
5017  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5018  __PYX_ERR(0, 75, __pyx_L1_error)
5019  }
5020  __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
5021  __Pyx_GOTREF(__pyx_t_4);
5022  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 75, __pyx_L1_error)
5023  __Pyx_GOTREF(__pyx_t_8);
5024  __pyx_t_10 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_4), (char *) "c", (char *) __pyx_t_7);
5025  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 75, __pyx_L1_error)
5026  __Pyx_GOTREF(__pyx_t_10);
5027  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5028  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5029  __pyx_t_4 = NULL;
5030  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5031  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
5032  if (likely(__pyx_t_4)) {
5033  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5034  __Pyx_INCREF(__pyx_t_4);
5035  __Pyx_INCREF(function);
5036  __Pyx_DECREF_SET(__pyx_t_5, function);
5037  }
5038  }
5039  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_10));
5040  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5041  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5042  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
5043  __Pyx_GOTREF(__pyx_t_3);
5044  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5045 
5046  /* "cpartitioning.pyx":76
5047  * return (
5048  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5049  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
5050  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5051  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5052  */
5053  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
5054  __Pyx_GOTREF(__pyx_t_4);
5055  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 76, __pyx_L1_error)
5056  __Pyx_GOTREF(__pyx_t_8);
5057  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5058  __pyx_t_7 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
5059  if (!__pyx_t_7) {
5060  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5061  __PYX_ERR(0, 76, __pyx_L1_error)
5062  }
5063  __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 76, __pyx_L1_error)
5064  __Pyx_GOTREF(__pyx_t_11);
5065  __pyx_t_4 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
5066  __Pyx_GOTREF(__pyx_t_4);
5067  __pyx_t_10 = __pyx_array_new(__pyx_t_4, sizeof(int), PyBytes_AS_STRING(__pyx_t_11), (char *) "c", (char *) __pyx_t_7);
5068  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 76, __pyx_L1_error)
5069  __Pyx_GOTREF(__pyx_t_10);
5070  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5071  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5072  __pyx_t_11 = NULL;
5073  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
5074  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
5075  if (likely(__pyx_t_11)) {
5076  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
5077  __Pyx_INCREF(__pyx_t_11);
5078  __Pyx_INCREF(function);
5079  __Pyx_DECREF_SET(__pyx_t_8, function);
5080  }
5081  }
5082  __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_10));
5083  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5084  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5085  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
5086  __Pyx_GOTREF(__pyx_t_5);
5087  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5088 
5089  /* "cpartitioning.pyx":77
5090  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5091  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5092  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5093  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5094  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5095  */
5096  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L1_error)
5097  __Pyx_GOTREF(__pyx_t_11);
5098  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
5099  __Pyx_GOTREF(__pyx_t_4);
5100  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5101  __pyx_t_7 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
5102  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L1_error)
5103  __Pyx_GOTREF(__pyx_t_11);
5104  __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_t_11, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 77, __pyx_L1_error)
5105  __Pyx_GOTREF(__pyx_t_12);
5106  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5107  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error)
5108  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5109  if (!__pyx_t_7) {
5110  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5111  __PYX_ERR(0, 77, __pyx_L1_error)
5112  }
5113  __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L1_error)
5114  __Pyx_GOTREF(__pyx_t_11);
5115  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 77, __pyx_L1_error)
5116  __Pyx_GOTREF(__pyx_t_12);
5117  __pyx_t_10 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_11), (char *) "c", (char *) __pyx_t_7);
5118  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 77, __pyx_L1_error)
5119  __Pyx_GOTREF(__pyx_t_10);
5120  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5121  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5122  __pyx_t_11 = NULL;
5123  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5124  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
5125  if (likely(__pyx_t_11)) {
5126  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5127  __Pyx_INCREF(__pyx_t_11);
5128  __Pyx_INCREF(function);
5129  __Pyx_DECREF_SET(__pyx_t_4, function);
5130  }
5131  }
5132  __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_t_10));
5133  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5134  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5135  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 77, __pyx_L1_error)
5136  __Pyx_GOTREF(__pyx_t_8);
5137  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5138 
5139  /* "cpartitioning.pyx":78
5140  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5141  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5142  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
5143  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5144  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5145  */
5146  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5147  __Pyx_GOTREF(__pyx_t_11);
5148  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 78, __pyx_L1_error)
5149  __Pyx_GOTREF(__pyx_t_12);
5150  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5151  __pyx_t_7 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
5152  if (!__pyx_t_7) {
5153  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5154  __PYX_ERR(0, 78, __pyx_L1_error)
5155  }
5156  __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 78, __pyx_L1_error)
5157  __Pyx_GOTREF(__pyx_t_13);
5158  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5159  __Pyx_GOTREF(__pyx_t_11);
5160  __pyx_t_10 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_13), (char *) "c", (char *) __pyx_t_7);
5161  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 78, __pyx_L1_error)
5162  __Pyx_GOTREF(__pyx_t_10);
5163  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5164  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5165  __pyx_t_13 = NULL;
5166  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
5167  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
5168  if (likely(__pyx_t_13)) {
5169  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
5170  __Pyx_INCREF(__pyx_t_13);
5171  __Pyx_INCREF(function);
5172  __Pyx_DECREF_SET(__pyx_t_12, function);
5173  }
5174  }
5175  __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_12, ((PyObject *)__pyx_t_10));
5176  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5177  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5178  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error)
5179  __Pyx_GOTREF(__pyx_t_4);
5180  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5181 
5182  /* "cpartitioning.pyx":79
5183  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5184  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5185  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5186  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5187  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5188  */
5189  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 79, __pyx_L1_error)
5190  __Pyx_GOTREF(__pyx_t_13);
5191  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 79, __pyx_L1_error)
5192  __Pyx_GOTREF(__pyx_t_11);
5193  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5194  __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
5195  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 79, __pyx_L1_error)
5196  __Pyx_GOTREF(__pyx_t_13);
5197  __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_t_13, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 79, __pyx_L1_error)
5198  __Pyx_GOTREF(__pyx_t_14);
5199  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5200  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error)
5201  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5202  if (!__pyx_t_7) {
5203  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5204  __PYX_ERR(0, 79, __pyx_L1_error)
5205  }
5206  __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 79, __pyx_L1_error)
5207  __Pyx_GOTREF(__pyx_t_13);
5208  __pyx_t_14 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 79, __pyx_L1_error)
5209  __Pyx_GOTREF(__pyx_t_14);
5210  __pyx_t_10 = __pyx_array_new(__pyx_t_14, sizeof(int), PyBytes_AS_STRING(__pyx_t_13), (char *) "c", (char *) __pyx_t_7);
5211  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 79, __pyx_L1_error)
5212  __Pyx_GOTREF(__pyx_t_10);
5213  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5214  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5215  __pyx_t_13 = NULL;
5216  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
5217  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
5218  if (likely(__pyx_t_13)) {
5219  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
5220  __Pyx_INCREF(__pyx_t_13);
5221  __Pyx_INCREF(function);
5222  __Pyx_DECREF_SET(__pyx_t_11, function);
5223  }
5224  }
5225  __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_10));
5226  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5227  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5228  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 79, __pyx_L1_error)
5229  __Pyx_GOTREF(__pyx_t_12);
5230  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5231 
5232  /* "cpartitioning.pyx":80
5233  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5234  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5235  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
5236  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5237  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
5238  */
5239  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 80, __pyx_L1_error)
5240  __Pyx_GOTREF(__pyx_t_13);
5241  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 80, __pyx_L1_error)
5242  __Pyx_GOTREF(__pyx_t_14);
5243  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5244  __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
5245  if (!__pyx_t_7) {
5246  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5247  __PYX_ERR(0, 80, __pyx_L1_error)
5248  }
5249  __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 80, __pyx_L1_error)
5250  __Pyx_GOTREF(__pyx_t_15);
5251  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 80, __pyx_L1_error)
5252  __Pyx_GOTREF(__pyx_t_13);
5253  __pyx_t_10 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_15), (char *) "c", (char *) __pyx_t_7);
5254  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 80, __pyx_L1_error)
5255  __Pyx_GOTREF(__pyx_t_10);
5256  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5257  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5258  __pyx_t_15 = NULL;
5259  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
5260  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
5261  if (likely(__pyx_t_15)) {
5262  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
5263  __Pyx_INCREF(__pyx_t_15);
5264  __Pyx_INCREF(function);
5265  __Pyx_DECREF_SET(__pyx_t_14, function);
5266  }
5267  }
5268  __pyx_t_11 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_14, ((PyObject *)__pyx_t_10));
5269  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5270  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5271  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 80, __pyx_L1_error)
5272  __Pyx_GOTREF(__pyx_t_11);
5273  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5274 
5275  /* "cpartitioning.pyx":81
5276  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5277  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5278  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5279  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
5280  * )
5281  */
5282  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 81, __pyx_L1_error)
5283  __Pyx_GOTREF(__pyx_t_15);
5284  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 81, __pyx_L1_error)
5285  __Pyx_GOTREF(__pyx_t_13);
5286  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5287  __pyx_t_7 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
5288  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 81, __pyx_L1_error)
5289  __Pyx_GOTREF(__pyx_t_15);
5290  __pyx_t_16 = __Pyx_PyInt_AddObjC(__pyx_t_15, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 81, __pyx_L1_error)
5291  __Pyx_GOTREF(__pyx_t_16);
5292  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5293  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error)
5294  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5295  if (!__pyx_t_7) {
5296  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5297  __PYX_ERR(0, 81, __pyx_L1_error)
5298  }
5299  __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 81, __pyx_L1_error)
5300  __Pyx_GOTREF(__pyx_t_15);
5301  __pyx_t_16 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 81, __pyx_L1_error)
5302  __Pyx_GOTREF(__pyx_t_16);
5303  __pyx_t_10 = __pyx_array_new(__pyx_t_16, sizeof(int), PyBytes_AS_STRING(__pyx_t_15), (char *) "c", (char *) __pyx_t_7);
5304  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 81, __pyx_L1_error)
5305  __Pyx_GOTREF(__pyx_t_10);
5306  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5307  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5308  __pyx_t_15 = NULL;
5309  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
5310  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13);
5311  if (likely(__pyx_t_15)) {
5312  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
5313  __Pyx_INCREF(__pyx_t_15);
5314  __Pyx_INCREF(function);
5315  __Pyx_DECREF_SET(__pyx_t_13, function);
5316  }
5317  }
5318  __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_10));
5319  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5320  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5321  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 81, __pyx_L1_error)
5322  __Pyx_GOTREF(__pyx_t_14);
5323  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5324 
5325  /* "cpartitioning.pyx":82
5326  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5327  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5328  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
5329  * )
5330  *
5331  */
5332  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 82, __pyx_L1_error)
5333  __Pyx_GOTREF(__pyx_t_15);
5334  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 82, __pyx_L1_error)
5335  __Pyx_GOTREF(__pyx_t_16);
5336  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5337  __pyx_t_7 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
5338  if (!__pyx_t_7) {
5339  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5340  __PYX_ERR(0, 82, __pyx_L1_error)
5341  }
5342  __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 82, __pyx_L1_error)
5343  __Pyx_GOTREF(__pyx_t_17);
5344  __pyx_t_15 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 82, __pyx_L1_error)
5345  __Pyx_GOTREF(__pyx_t_15);
5346  __pyx_t_10 = __pyx_array_new(__pyx_t_15, sizeof(int), PyBytes_AS_STRING(__pyx_t_17), (char *) "c", (char *) __pyx_t_7);
5347  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 82, __pyx_L1_error)
5348  __Pyx_GOTREF(__pyx_t_10);
5349  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5350  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5351  __pyx_t_17 = NULL;
5352  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
5353  __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
5354  if (likely(__pyx_t_17)) {
5355  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
5356  __Pyx_INCREF(__pyx_t_17);
5357  __Pyx_INCREF(function);
5358  __Pyx_DECREF_SET(__pyx_t_16, function);
5359  }
5360  }
5361  __pyx_t_13 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_17, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_16, ((PyObject *)__pyx_t_10));
5362  __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
5363  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5364  if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 82, __pyx_L1_error)
5365  __Pyx_GOTREF(__pyx_t_13);
5366  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5367 
5368  /* "cpartitioning.pyx":75
5369  * nLayersOfOverlap)
5370  * return (
5371  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5372  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5373  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5374  */
5375  __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 75, __pyx_L1_error)
5376  __Pyx_GOTREF(__pyx_t_16);
5377  __Pyx_GIVEREF(__pyx_t_3);
5378  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3);
5379  __Pyx_GIVEREF(__pyx_t_5);
5380  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_5);
5381  __Pyx_GIVEREF(__pyx_t_8);
5382  PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_8);
5383  __Pyx_GIVEREF(__pyx_t_4);
5384  PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_4);
5385  __Pyx_GIVEREF(__pyx_t_12);
5386  PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_12);
5387  __Pyx_GIVEREF(__pyx_t_11);
5388  PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_11);
5389  __Pyx_GIVEREF(__pyx_t_14);
5390  PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_14);
5391  __Pyx_GIVEREF(__pyx_t_13);
5392  PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_13);
5393  __pyx_t_3 = 0;
5394  __pyx_t_5 = 0;
5395  __pyx_t_8 = 0;
5396  __pyx_t_4 = 0;
5397  __pyx_t_12 = 0;
5398  __pyx_t_11 = 0;
5399  __pyx_t_14 = 0;
5400  __pyx_t_13 = 0;
5401  __pyx_r = __pyx_t_16;
5402  __pyx_t_16 = 0;
5403  goto __pyx_L0;
5404 
5405  /* "cpartitioning.pyx":65
5406  * )
5407  *
5408  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
5409  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5410  * if not isinstance(filebase, bytes):
5411  */
5412 
5413  /* function exit code */
5414  __pyx_L1_error:;
5415  __Pyx_XDECREF(__pyx_t_3);
5416  __Pyx_XDECREF(__pyx_t_4);
5417  __Pyx_XDECREF(__pyx_t_5);
5418  __Pyx_XDECREF(__pyx_t_8);
5419  __Pyx_XDECREF(((PyObject *)__pyx_t_10));
5420  __Pyx_XDECREF(__pyx_t_11);
5421  __Pyx_XDECREF(__pyx_t_12);
5422  __Pyx_XDECREF(__pyx_t_13);
5423  __Pyx_XDECREF(__pyx_t_14);
5424  __Pyx_XDECREF(__pyx_t_15);
5425  __Pyx_XDECREF(__pyx_t_16);
5426  __Pyx_XDECREF(__pyx_t_17);
5427  __Pyx_AddTraceback("cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
5428  __pyx_r = NULL;
5429  __pyx_L0:;
5430  __Pyx_XDECREF(__pyx_v_filebase);
5431  __Pyx_XGIVEREF(__pyx_r);
5432  __Pyx_RefNannyFinishContext();
5433  return __pyx_r;
5434 }
5435 
5436 /* "cpartitioning.pyx":85
5437  * )
5438  *
5439  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
5440  * int nSpace,
5441  * cmeshTools.CMesh cmesh,
5442  */
5443 
5444 /* Python wrapper */
5445 static PyObject *__pyx_pw_13cpartitioning_9buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5446 static PyMethodDef __pyx_mdef_13cpartitioning_9buildQuadraticLocal2GlobalMappings = {"buildQuadraticLocal2GlobalMappings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_9buildQuadraticLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
5447 static PyObject *__pyx_pw_13cpartitioning_9buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5448  struct PyMPICommObject *__pyx_v_comm = 0;
5449  int __pyx_v_nSpace;
5450  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
5451  CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
5452  PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
5453  PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned = 0;
5454  PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned = 0;
5455  PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned = 0;
5456  PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
5457  PyArrayObject *__pyx_v_nodeNumbering_subdomain2global = 0;
5458  PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global = 0;
5459  PyArrayObject *__pyx_v_edgeNumbering_subdomain2global = 0;
5460  PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned = 0;
5461  PyArrayObject *__pyx_v_quadratic_subdomain_l2g = 0;
5462  PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global = 0;
5463  PyArrayObject *__pyx_v_quadratic_lagrangeNodes = 0;
5464  int __pyx_lineno = 0;
5465  const char *__pyx_filename = NULL;
5466  int __pyx_clineno = 0;
5467  PyObject *__pyx_r = 0;
5468  __Pyx_RefNannyDeclarations
5469  __Pyx_RefNannySetupContext("buildQuadraticLocal2GlobalMappings (wrapper)", 0);
5470  {
5471  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nSpace,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_nodeOffsets_subdomain_owned,&__pyx_n_s_elementBoundaryOffsets_subdomain,&__pyx_n_s_edgeOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_nodeNumbering_subdomain2global,&__pyx_n_s_elementBoundaryNumbering_subdoma,&__pyx_n_s_edgeNumbering_subdomain2global,&__pyx_n_s_quadratic_dof_offsets_subdomain,&__pyx_n_s_quadratic_subdomain_l2g,&__pyx_n_s_quadraticNumbering_subdomain2glo,&__pyx_n_s_quadratic_lagrangeNodes,0};
5472  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
5473  if (unlikely(__pyx_kwds)) {
5474  Py_ssize_t kw_args;
5475  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5476  switch (pos_args) {
5477  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5478  CYTHON_FALLTHROUGH;
5479  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5480  CYTHON_FALLTHROUGH;
5481  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5482  CYTHON_FALLTHROUGH;
5483  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5484  CYTHON_FALLTHROUGH;
5485  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5486  CYTHON_FALLTHROUGH;
5487  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5488  CYTHON_FALLTHROUGH;
5489  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5490  CYTHON_FALLTHROUGH;
5491  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5492  CYTHON_FALLTHROUGH;
5493  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5494  CYTHON_FALLTHROUGH;
5495  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5496  CYTHON_FALLTHROUGH;
5497  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5498  CYTHON_FALLTHROUGH;
5499  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5500  CYTHON_FALLTHROUGH;
5501  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5502  CYTHON_FALLTHROUGH;
5503  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5504  CYTHON_FALLTHROUGH;
5505  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5506  CYTHON_FALLTHROUGH;
5507  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5508  CYTHON_FALLTHROUGH;
5509  case 0: break;
5510  default: goto __pyx_L5_argtuple_error;
5511  }
5512  kw_args = PyDict_Size(__pyx_kwds);
5513  switch (pos_args) {
5514  case 0:
5515  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
5516  else goto __pyx_L5_argtuple_error;
5517  CYTHON_FALLTHROUGH;
5518  case 1:
5519  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
5520  else {
5521  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 1); __PYX_ERR(0, 85, __pyx_L3_error)
5522  }
5523  CYTHON_FALLTHROUGH;
5524  case 2:
5525  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
5526  else {
5527  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 2); __PYX_ERR(0, 85, __pyx_L3_error)
5528  }
5529  CYTHON_FALLTHROUGH;
5530  case 3:
5531  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
5532  else {
5533  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 3); __PYX_ERR(0, 85, __pyx_L3_error)
5534  }
5535  CYTHON_FALLTHROUGH;
5536  case 4:
5537  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
5538  else {
5539  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 4); __PYX_ERR(0, 85, __pyx_L3_error)
5540  }
5541  CYTHON_FALLTHROUGH;
5542  case 5:
5543  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeOffsets_subdomain_owned)) != 0)) kw_args--;
5544  else {
5545  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 5); __PYX_ERR(0, 85, __pyx_L3_error)
5546  }
5547  CYTHON_FALLTHROUGH;
5548  case 6:
5549  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryOffsets_subdomain)) != 0)) kw_args--;
5550  else {
5551  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 6); __PYX_ERR(0, 85, __pyx_L3_error)
5552  }
5553  CYTHON_FALLTHROUGH;
5554  case 7:
5555  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeOffsets_subdomain_owned)) != 0)) kw_args--;
5556  else {
5557  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 7); __PYX_ERR(0, 85, __pyx_L3_error)
5558  }
5559  CYTHON_FALLTHROUGH;
5560  case 8:
5561  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
5562  else {
5563  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 8); __PYX_ERR(0, 85, __pyx_L3_error)
5564  }
5565  CYTHON_FALLTHROUGH;
5566  case 9:
5567  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeNumbering_subdomain2global)) != 0)) kw_args--;
5568  else {
5569  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 9); __PYX_ERR(0, 85, __pyx_L3_error)
5570  }
5571  CYTHON_FALLTHROUGH;
5572  case 10:
5573  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryNumbering_subdoma)) != 0)) kw_args--;
5574  else {
5575  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 10); __PYX_ERR(0, 85, __pyx_L3_error)
5576  }
5577  CYTHON_FALLTHROUGH;
5578  case 11:
5579  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeNumbering_subdomain2global)) != 0)) kw_args--;
5580  else {
5581  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 11); __PYX_ERR(0, 85, __pyx_L3_error)
5582  }
5583  CYTHON_FALLTHROUGH;
5584  case 12:
5585  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_dof_offsets_subdomain)) != 0)) kw_args--;
5586  else {
5587  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 12); __PYX_ERR(0, 85, __pyx_L3_error)
5588  }
5589  CYTHON_FALLTHROUGH;
5590  case 13:
5591  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_subdomain_l2g)) != 0)) kw_args--;
5592  else {
5593  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 13); __PYX_ERR(0, 85, __pyx_L3_error)
5594  }
5595  CYTHON_FALLTHROUGH;
5596  case 14:
5597  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadraticNumbering_subdomain2glo)) != 0)) kw_args--;
5598  else {
5599  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 14); __PYX_ERR(0, 85, __pyx_L3_error)
5600  }
5601  CYTHON_FALLTHROUGH;
5602  case 15:
5603  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_lagrangeNodes)) != 0)) kw_args--;
5604  else {
5605  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 15); __PYX_ERR(0, 85, __pyx_L3_error)
5606  }
5607  }
5608  if (unlikely(kw_args > 0)) {
5609  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildQuadraticLocal2GlobalMappings") < 0)) __PYX_ERR(0, 85, __pyx_L3_error)
5610  }
5611  } else if (PyTuple_GET_SIZE(__pyx_args) != 16) {
5612  goto __pyx_L5_argtuple_error;
5613  } else {
5614  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5615  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5616  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5617  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5618  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5619  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5620  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5621  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5622  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5623  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5624  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5625  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5626  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5627  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5628  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5629  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5630  }
5631  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
5632  __pyx_v_nSpace = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error)
5633  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
5634  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
5635  __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
5636  __pyx_v_nodeOffsets_subdomain_owned = ((PyArrayObject *)values[5]);
5637  __pyx_v_elementBoundaryOffsets_subdomain_owned = ((PyArrayObject *)values[6]);
5638  __pyx_v_edgeOffsets_subdomain_owned = ((PyArrayObject *)values[7]);
5639  __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[8]);
5640  __pyx_v_nodeNumbering_subdomain2global = ((PyArrayObject *)values[9]);
5641  __pyx_v_elementBoundaryNumbering_subdomain2global = ((PyArrayObject *)values[10]);
5642  __pyx_v_edgeNumbering_subdomain2global = ((PyArrayObject *)values[11]);
5643  __pyx_v_quadratic_dof_offsets_subdomain_owned = ((PyArrayObject *)values[12]);
5644  __pyx_v_quadratic_subdomain_l2g = ((PyArrayObject *)values[13]);
5645  __pyx_v_quadraticNumbering_subdomain2global = ((PyArrayObject *)values[14]);
5646  __pyx_v_quadratic_lagrangeNodes = ((PyArrayObject *)values[15]);
5647  }
5648  goto __pyx_L4_argument_unpacking_done;
5649  __pyx_L5_argtuple_error:;
5650  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 85, __pyx_L3_error)
5651  __pyx_L3_error:;
5652  __Pyx_AddTraceback("cpartitioning.buildQuadraticLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
5653  __Pyx_RefNannyFinishContext();
5654  return NULL;
5655  __pyx_L4_argument_unpacking_done:;
5656  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 85, __pyx_L1_error)
5657  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 87, __pyx_L1_error)
5658  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 88, __pyx_L1_error)
5659  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 89, __pyx_L1_error)
5660  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "nodeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 90, __pyx_L1_error)
5661  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryOffsets_subdomain_owned", 0))) __PYX_ERR(0, 91, __pyx_L1_error)
5662  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "edgeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 92, __pyx_L1_error)
5663  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 93, __pyx_L1_error)
5664  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "nodeNumbering_subdomain2global", 0))) __PYX_ERR(0, 94, __pyx_L1_error)
5665  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryNumbering_subdomain2global", 0))) __PYX_ERR(0, 95, __pyx_L1_error)
5666  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "edgeNumbering_subdomain2global", 0))) __PYX_ERR(0, 96, __pyx_L1_error)
5667  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "quadratic_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 97, __pyx_L1_error)
5668  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1, "quadratic_subdomain_l2g", 0))) __PYX_ERR(0, 98, __pyx_L1_error)
5669  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadraticNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "quadraticNumbering_subdomain2global", 0))) __PYX_ERR(0, 99, __pyx_L1_error)
5670  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_lagrangeNodes), __pyx_ptype_5numpy_ndarray, 1, "quadratic_lagrangeNodes", 0))) __PYX_ERR(0, 100, __pyx_L1_error)
5671  __pyx_r = __pyx_pf_13cpartitioning_8buildQuadraticLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nSpace, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_edgeOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_edgeNumbering_subdomain2global, __pyx_v_quadratic_dof_offsets_subdomain_owned, __pyx_v_quadratic_subdomain_l2g, __pyx_v_quadraticNumbering_subdomain2global, __pyx_v_quadratic_lagrangeNodes);
5672 
5673  /* function exit code */
5674  goto __pyx_L0;
5675  __pyx_L1_error:;
5676  __pyx_r = NULL;
5677  __pyx_L0:;
5678  __Pyx_RefNannyFinishContext();
5679  return __pyx_r;
5680 }
5681 
5682 static PyObject *__pyx_pf_13cpartitioning_8buildQuadraticLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes) {
5683  int __pyx_v_nDOF_all_processes;
5684  int __pyx_v_nDOF_subdomain;
5685  int __pyx_v_max_dof_neighbors;
5686  PyObject *__pyx_r = NULL;
5687  __Pyx_RefNannyDeclarations
5688  PyObject *__pyx_t_1 = NULL;
5689  PyObject *__pyx_t_2 = NULL;
5690  PyObject *__pyx_t_3 = NULL;
5691  PyObject *__pyx_t_4 = NULL;
5692  int __pyx_lineno = 0;
5693  const char *__pyx_filename = NULL;
5694  int __pyx_clineno = 0;
5695  __Pyx_RefNannySetupContext("buildQuadraticLocal2GlobalMappings", 0);
5696 
5697  /* "cpartitioning.pyx":101
5698  * np.ndarray quadraticNumbering_subdomain2global,
5699  * np.ndarray quadratic_lagrangeNodes):
5700  * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
5701  * cdef int nDOF_subdomain=0
5702  * cdef int max_dof_neighbors=0
5703  */
5704  __pyx_v_nDOF_all_processes = 0;
5705 
5706  /* "cpartitioning.pyx":102
5707  * np.ndarray quadratic_lagrangeNodes):
5708  * cdef int nDOF_all_processes=0
5709  * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
5710  * cdef int max_dof_neighbors=0
5711  * if nSpace == 1:
5712  */
5713  __pyx_v_nDOF_subdomain = 0;
5714 
5715  /* "cpartitioning.pyx":103
5716  * cdef int nDOF_all_processes=0
5717  * cdef int nDOF_subdomain=0
5718  * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
5719  * if nSpace == 1:
5720  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
5721  */
5722  __pyx_v_max_dof_neighbors = 0;
5723 
5724  /* "cpartitioning.pyx":104
5725  * cdef int nDOF_subdomain=0
5726  * cdef int max_dof_neighbors=0
5727  * if nSpace == 1: # <<<<<<<<<<<<<<
5728  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
5729  * cmesh.mesh,
5730  */
5731  switch (__pyx_v_nSpace) {
5732  case 1:
5733 
5734  /* "cpartitioning.pyx":105
5735  * cdef int max_dof_neighbors=0
5736  * if nSpace == 1:
5737  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi, # <<<<<<<<<<<<<<
5738  * cmesh.mesh,
5739  * <int*>(elementOffsets_subdomain_owned.data),
5740  */
5741  (void)(proteus::buildQuadraticSubdomain2GlobalMappings_1d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_elementOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_elementNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
5742 
5743  /* "cpartitioning.pyx":104
5744  * cdef int nDOF_subdomain=0
5745  * cdef int max_dof_neighbors=0
5746  * if nSpace == 1: # <<<<<<<<<<<<<<
5747  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
5748  * cmesh.mesh,
5749  */
5750  break;
5751  case 2:
5752 
5753  /* "cpartitioning.pyx":119
5754  * <double*>(quadratic_lagrangeNodes.data));
5755  * elif nSpace == 2:
5756  * buildQuadraticSubdomain2GlobalMappings_2d(comm.ob_mpi, # <<<<<<<<<<<<<<
5757  * cmesh.mesh,
5758  * <int*>(elementBoundaryOffsets_subdomain_owned.data),
5759  */
5760  (void)(proteus::buildQuadraticSubdomain2GlobalMappings_2d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_elementBoundaryOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_elementBoundaryNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
5761 
5762  /* "cpartitioning.pyx":118
5763  * <int*>(quadraticNumbering_subdomain2global.data),
5764  * <double*>(quadratic_lagrangeNodes.data));
5765  * elif nSpace == 2: # <<<<<<<<<<<<<<
5766  * buildQuadraticSubdomain2GlobalMappings_2d(comm.ob_mpi,
5767  * cmesh.mesh,
5768  */
5769  break;
5770  default:
5771 
5772  /* "cpartitioning.pyx":133
5773  * <double*>(quadratic_lagrangeNodes.data))
5774  * else:
5775  * buildQuadraticSubdomain2GlobalMappings_3d(comm.ob_mpi, # <<<<<<<<<<<<<<
5776  * cmesh.mesh,
5777  * <int*>(edgeOffsets_subdomain_owned.data),
5778  */
5779  (void)(proteus::buildQuadraticSubdomain2GlobalMappings_3d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_edgeOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_edgeNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
5780  break;
5781  }
5782 
5783  /* "cpartitioning.pyx":146
5784  * <int*>(quadraticNumbering_subdomain2global.data),
5785  * <double*>(quadratic_lagrangeNodes.data))
5786  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
5787  * nDOF_subdomain,
5788  * max_dof_neighbors)
5789  */
5790  __Pyx_XDECREF(__pyx_r);
5791  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
5792  __Pyx_GOTREF(__pyx_t_1);
5793 
5794  /* "cpartitioning.pyx":147
5795  * <double*>(quadratic_lagrangeNodes.data))
5796  * return (nDOF_all_processes,
5797  * nDOF_subdomain, # <<<<<<<<<<<<<<
5798  * max_dof_neighbors)
5799  *
5800  */
5801  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
5802  __Pyx_GOTREF(__pyx_t_2);
5803 
5804  /* "cpartitioning.pyx":148
5805  * return (nDOF_all_processes,
5806  * nDOF_subdomain,
5807  * max_dof_neighbors) # <<<<<<<<<<<<<<
5808  *
5809  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm,
5810  */
5811  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
5812  __Pyx_GOTREF(__pyx_t_3);
5813 
5814  /* "cpartitioning.pyx":146
5815  * <int*>(quadraticNumbering_subdomain2global.data),
5816  * <double*>(quadratic_lagrangeNodes.data))
5817  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
5818  * nDOF_subdomain,
5819  * max_dof_neighbors)
5820  */
5821  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
5822  __Pyx_GOTREF(__pyx_t_4);
5823  __Pyx_GIVEREF(__pyx_t_1);
5824  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5825  __Pyx_GIVEREF(__pyx_t_2);
5826  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
5827  __Pyx_GIVEREF(__pyx_t_3);
5828  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
5829  __pyx_t_1 = 0;
5830  __pyx_t_2 = 0;
5831  __pyx_t_3 = 0;
5832  __pyx_r = __pyx_t_4;
5833  __pyx_t_4 = 0;
5834  goto __pyx_L0;
5835 
5836  /* "cpartitioning.pyx":85
5837  * )
5838  *
5839  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
5840  * int nSpace,
5841  * cmeshTools.CMesh cmesh,
5842  */
5843 
5844  /* function exit code */
5845  __pyx_L1_error:;
5846  __Pyx_XDECREF(__pyx_t_1);
5847  __Pyx_XDECREF(__pyx_t_2);
5848  __Pyx_XDECREF(__pyx_t_3);
5849  __Pyx_XDECREF(__pyx_t_4);
5850  __Pyx_AddTraceback("cpartitioning.buildQuadraticLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
5851  __pyx_r = NULL;
5852  __pyx_L0:;
5853  __Pyx_XGIVEREF(__pyx_r);
5854  __Pyx_RefNannyFinishContext();
5855  return __pyx_r;
5856 }
5857 
5858 /* "cpartitioning.pyx":150
5859  * max_dof_neighbors)
5860  *
5861  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
5862  * int nSpace,
5863  * cmeshTools.CMesh cmesh,
5864  */
5865 
5866 /* Python wrapper */
5867 static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticCubeLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5868 static PyMethodDef __pyx_mdef_13cpartitioning_11buildQuadraticCubeLocal2GlobalMappings = {"buildQuadraticCubeLocal2GlobalMappings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_11buildQuadraticCubeLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
5869 static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticCubeLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5870  struct PyMPICommObject *__pyx_v_comm = 0;
5871  int __pyx_v_nSpace;
5872  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
5873  CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
5874  CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
5875  PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned = 0;
5876  CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned = 0;
5877  PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned = 0;
5878  CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
5879  PyArrayObject *__pyx_v_nodeNumbering_subdomain2global = 0;
5880  CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global = 0;
5881  PyArrayObject *__pyx_v_edgeNumbering_subdomain2global = 0;
5882  PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned = 0;
5883  PyArrayObject *__pyx_v_quadratic_subdomain_l2g = 0;
5884  PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global = 0;
5885  PyArrayObject *__pyx_v_quadratic_lagrangeNodes = 0;
5886  int __pyx_lineno = 0;
5887  const char *__pyx_filename = NULL;
5888  int __pyx_clineno = 0;
5889  PyObject *__pyx_r = 0;
5890  __Pyx_RefNannyDeclarations
5891  __Pyx_RefNannySetupContext("buildQuadraticCubeLocal2GlobalMappings (wrapper)", 0);
5892  {
5893  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nSpace,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_nodeOffsets_subdomain_owned,&__pyx_n_s_elementBoundaryOffsets_subdomain,&__pyx_n_s_edgeOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_nodeNumbering_subdomain2global,&__pyx_n_s_elementBoundaryNumbering_subdoma,&__pyx_n_s_edgeNumbering_subdomain2global,&__pyx_n_s_quadratic_dof_offsets_subdomain,&__pyx_n_s_quadratic_subdomain_l2g,&__pyx_n_s_quadraticNumbering_subdomain2glo,&__pyx_n_s_quadratic_lagrangeNodes,0};
5894  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
5895  if (unlikely(__pyx_kwds)) {
5896  Py_ssize_t kw_args;
5897  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5898  switch (pos_args) {
5899  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5900  CYTHON_FALLTHROUGH;
5901  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5902  CYTHON_FALLTHROUGH;
5903  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5904  CYTHON_FALLTHROUGH;
5905  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5906  CYTHON_FALLTHROUGH;
5907  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5908  CYTHON_FALLTHROUGH;
5909  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5910  CYTHON_FALLTHROUGH;
5911  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5912  CYTHON_FALLTHROUGH;
5913  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5914  CYTHON_FALLTHROUGH;
5915  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5916  CYTHON_FALLTHROUGH;
5917  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5918  CYTHON_FALLTHROUGH;
5919  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5920  CYTHON_FALLTHROUGH;
5921  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5922  CYTHON_FALLTHROUGH;
5923  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5924  CYTHON_FALLTHROUGH;
5925  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5926  CYTHON_FALLTHROUGH;
5927  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5928  CYTHON_FALLTHROUGH;
5929  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5930  CYTHON_FALLTHROUGH;
5931  case 0: break;
5932  default: goto __pyx_L5_argtuple_error;
5933  }
5934  kw_args = PyDict_Size(__pyx_kwds);
5935  switch (pos_args) {
5936  case 0:
5937  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
5938  else goto __pyx_L5_argtuple_error;
5939  CYTHON_FALLTHROUGH;
5940  case 1:
5941  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
5942  else {
5943  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 1); __PYX_ERR(0, 150, __pyx_L3_error)
5944  }
5945  CYTHON_FALLTHROUGH;
5946  case 2:
5947  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
5948  else {
5949  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 2); __PYX_ERR(0, 150, __pyx_L3_error)
5950  }
5951  CYTHON_FALLTHROUGH;
5952  case 3:
5953  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
5954  else {
5955  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 3); __PYX_ERR(0, 150, __pyx_L3_error)
5956  }
5957  CYTHON_FALLTHROUGH;
5958  case 4:
5959  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
5960  else {
5961  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 4); __PYX_ERR(0, 150, __pyx_L3_error)
5962  }
5963  CYTHON_FALLTHROUGH;
5964  case 5:
5965  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeOffsets_subdomain_owned)) != 0)) kw_args--;
5966  else {
5967  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 5); __PYX_ERR(0, 150, __pyx_L3_error)
5968  }
5969  CYTHON_FALLTHROUGH;
5970  case 6:
5971  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryOffsets_subdomain)) != 0)) kw_args--;
5972  else {
5973  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 6); __PYX_ERR(0, 150, __pyx_L3_error)
5974  }
5975  CYTHON_FALLTHROUGH;
5976  case 7:
5977  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeOffsets_subdomain_owned)) != 0)) kw_args--;
5978  else {
5979  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 7); __PYX_ERR(0, 150, __pyx_L3_error)
5980  }
5981  CYTHON_FALLTHROUGH;
5982  case 8:
5983  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
5984  else {
5985  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 8); __PYX_ERR(0, 150, __pyx_L3_error)
5986  }
5987  CYTHON_FALLTHROUGH;
5988  case 9:
5989  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeNumbering_subdomain2global)) != 0)) kw_args--;
5990  else {
5991  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 9); __PYX_ERR(0, 150, __pyx_L3_error)
5992  }
5993  CYTHON_FALLTHROUGH;
5994  case 10:
5995  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryNumbering_subdoma)) != 0)) kw_args--;
5996  else {
5997  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 10); __PYX_ERR(0, 150, __pyx_L3_error)
5998  }
5999  CYTHON_FALLTHROUGH;
6000  case 11:
6001  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeNumbering_subdomain2global)) != 0)) kw_args--;
6002  else {
6003  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 11); __PYX_ERR(0, 150, __pyx_L3_error)
6004  }
6005  CYTHON_FALLTHROUGH;
6006  case 12:
6007  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_dof_offsets_subdomain)) != 0)) kw_args--;
6008  else {
6009  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 12); __PYX_ERR(0, 150, __pyx_L3_error)
6010  }
6011  CYTHON_FALLTHROUGH;
6012  case 13:
6013  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_subdomain_l2g)) != 0)) kw_args--;
6014  else {
6015  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 13); __PYX_ERR(0, 150, __pyx_L3_error)
6016  }
6017  CYTHON_FALLTHROUGH;
6018  case 14:
6019  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadraticNumbering_subdomain2glo)) != 0)) kw_args--;
6020  else {
6021  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 14); __PYX_ERR(0, 150, __pyx_L3_error)
6022  }
6023  CYTHON_FALLTHROUGH;
6024  case 15:
6025  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_lagrangeNodes)) != 0)) kw_args--;
6026  else {
6027  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 15); __PYX_ERR(0, 150, __pyx_L3_error)
6028  }
6029  }
6030  if (unlikely(kw_args > 0)) {
6031  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildQuadraticCubeLocal2GlobalMappings") < 0)) __PYX_ERR(0, 150, __pyx_L3_error)
6032  }
6033  } else if (PyTuple_GET_SIZE(__pyx_args) != 16) {
6034  goto __pyx_L5_argtuple_error;
6035  } else {
6036  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6037  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6038  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6039  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6040  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6041  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6042  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6043  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6044  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6045  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6046  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6047  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6048  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6049  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6050  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6051  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6052  }
6053  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
6054  __pyx_v_nSpace = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L3_error)
6055  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
6056  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
6057  __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
6058  __pyx_v_nodeOffsets_subdomain_owned = ((PyArrayObject *)values[5]);
6059  __pyx_v_elementBoundaryOffsets_subdomain_owned = ((PyArrayObject *)values[6]);
6060  __pyx_v_edgeOffsets_subdomain_owned = ((PyArrayObject *)values[7]);
6061  __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[8]);
6062  __pyx_v_nodeNumbering_subdomain2global = ((PyArrayObject *)values[9]);
6063  __pyx_v_elementBoundaryNumbering_subdomain2global = ((PyArrayObject *)values[10]);
6064  __pyx_v_edgeNumbering_subdomain2global = ((PyArrayObject *)values[11]);
6065  __pyx_v_quadratic_dof_offsets_subdomain_owned = ((PyArrayObject *)values[12]);
6066  __pyx_v_quadratic_subdomain_l2g = ((PyArrayObject *)values[13]);
6067  __pyx_v_quadraticNumbering_subdomain2global = ((PyArrayObject *)values[14]);
6068  __pyx_v_quadratic_lagrangeNodes = ((PyArrayObject *)values[15]);
6069  }
6070  goto __pyx_L4_argument_unpacking_done;
6071  __pyx_L5_argtuple_error:;
6072  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 150, __pyx_L3_error)
6073  __pyx_L3_error:;
6074  __Pyx_AddTraceback("cpartitioning.buildQuadraticCubeLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6075  __Pyx_RefNannyFinishContext();
6076  return NULL;
6077  __pyx_L4_argument_unpacking_done:;
6078  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 150, __pyx_L1_error)
6079  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 152, __pyx_L1_error)
6080  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 153, __pyx_L1_error)
6081  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 154, __pyx_L1_error)
6082  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "nodeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 155, __pyx_L1_error)
6083  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryOffsets_subdomain_owned", 0))) __PYX_ERR(0, 156, __pyx_L1_error)
6084  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "edgeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 157, __pyx_L1_error)
6085  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 158, __pyx_L1_error)
6086  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "nodeNumbering_subdomain2global", 0))) __PYX_ERR(0, 159, __pyx_L1_error)
6087  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryNumbering_subdomain2global", 0))) __PYX_ERR(0, 160, __pyx_L1_error)
6088  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "edgeNumbering_subdomain2global", 0))) __PYX_ERR(0, 161, __pyx_L1_error)
6089  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "quadratic_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 162, __pyx_L1_error)
6090  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1, "quadratic_subdomain_l2g", 0))) __PYX_ERR(0, 163, __pyx_L1_error)
6091  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadraticNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "quadraticNumbering_subdomain2global", 0))) __PYX_ERR(0, 164, __pyx_L1_error)
6092  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_lagrangeNodes), __pyx_ptype_5numpy_ndarray, 1, "quadratic_lagrangeNodes", 0))) __PYX_ERR(0, 165, __pyx_L1_error)
6093  __pyx_r = __pyx_pf_13cpartitioning_10buildQuadraticCubeLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nSpace, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_edgeOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_edgeNumbering_subdomain2global, __pyx_v_quadratic_dof_offsets_subdomain_owned, __pyx_v_quadratic_subdomain_l2g, __pyx_v_quadraticNumbering_subdomain2global, __pyx_v_quadratic_lagrangeNodes);
6094 
6095  /* function exit code */
6096  goto __pyx_L0;
6097  __pyx_L1_error:;
6098  __pyx_r = NULL;
6099  __pyx_L0:;
6100  __Pyx_RefNannyFinishContext();
6101  return __pyx_r;
6102 }
6103 
6104 static PyObject *__pyx_pf_13cpartitioning_10buildQuadraticCubeLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes) {
6105  int __pyx_v_nDOF_all_processes;
6106  int __pyx_v_nDOF_subdomain;
6107  int __pyx_v_max_dof_neighbors;
6108  PyObject *__pyx_r = NULL;
6109  __Pyx_RefNannyDeclarations
6110  PyObject *__pyx_t_1 = NULL;
6111  PyObject *__pyx_t_2 = NULL;
6112  PyObject *__pyx_t_3 = NULL;
6113  PyObject *__pyx_t_4 = NULL;
6114  int __pyx_lineno = 0;
6115  const char *__pyx_filename = NULL;
6116  int __pyx_clineno = 0;
6117  __Pyx_RefNannySetupContext("buildQuadraticCubeLocal2GlobalMappings", 0);
6118 
6119  /* "cpartitioning.pyx":166
6120  * np.ndarray quadraticNumbering_subdomain2global,
6121  * np.ndarray quadratic_lagrangeNodes):
6122  * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
6123  * cdef int nDOF_subdomain=0
6124  * cdef int max_dof_neighbors=0
6125  */
6126  __pyx_v_nDOF_all_processes = 0;
6127 
6128  /* "cpartitioning.pyx":167
6129  * np.ndarray quadratic_lagrangeNodes):
6130  * cdef int nDOF_all_processes=0
6131  * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
6132  * cdef int max_dof_neighbors=0
6133  * if nSpace == 1:
6134  */
6135  __pyx_v_nDOF_subdomain = 0;
6136 
6137  /* "cpartitioning.pyx":168
6138  * cdef int nDOF_all_processes=0
6139  * cdef int nDOF_subdomain=0
6140  * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
6141  * if nSpace == 1:
6142  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6143  */
6144  __pyx_v_max_dof_neighbors = 0;
6145 
6146  /* "cpartitioning.pyx":169
6147  * cdef int nDOF_subdomain=0
6148  * cdef int max_dof_neighbors=0
6149  * if nSpace == 1: # <<<<<<<<<<<<<<
6150  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6151  * elif nSpace == 2:
6152  */
6153  switch (__pyx_v_nSpace) {
6154  case 1:
6155 
6156  /* "cpartitioning.pyx":170
6157  * cdef int max_dof_neighbors=0
6158  * if nSpace == 1:
6159  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!" # <<<<<<<<<<<<<<
6160  * elif nSpace == 2:
6161  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
6162  */
6163  #ifndef CYTHON_WITHOUT_ASSERTIONS
6164  if (unlikely(!Py_OptimizeFlag)) {
6165  if (unlikely(!0)) {
6166  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_buildQuadraticCubeSubdomain2Glob);
6167  __PYX_ERR(0, 170, __pyx_L1_error)
6168  }
6169  }
6170  #endif
6171 
6172  /* "cpartitioning.pyx":169
6173  * cdef int nDOF_subdomain=0
6174  * cdef int max_dof_neighbors=0
6175  * if nSpace == 1: # <<<<<<<<<<<<<<
6176  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6177  * elif nSpace == 2:
6178  */
6179  break;
6180  case 2:
6181 
6182  /* "cpartitioning.pyx":172
6183  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6184  * elif nSpace == 2:
6185  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!" # <<<<<<<<<<<<<<
6186  * else:
6187  * buildQuadraticCubeSubdomain2GlobalMappings_3d(comm.ob_mpi,
6188  */
6189  #ifndef CYTHON_WITHOUT_ASSERTIONS
6190  if (unlikely(!Py_OptimizeFlag)) {
6191  if (unlikely(!0)) {
6192  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2);
6193  __PYX_ERR(0, 172, __pyx_L1_error)
6194  }
6195  }
6196  #endif
6197 
6198  /* "cpartitioning.pyx":171
6199  * if nSpace == 1:
6200  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6201  * elif nSpace == 2: # <<<<<<<<<<<<<<
6202  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
6203  * else:
6204  */
6205  break;
6206  default:
6207 
6208  /* "cpartitioning.pyx":174
6209  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
6210  * else:
6211  * buildQuadraticCubeSubdomain2GlobalMappings_3d(comm.ob_mpi, # <<<<<<<<<<<<<<
6212  * cmesh.mesh,
6213  * <int*>(edgeOffsets_subdomain_owned.data),
6214  */
6215  (void)(proteus::buildQuadraticCubeSubdomain2GlobalMappings_3d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_edgeOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_edgeNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
6216  break;
6217  }
6218 
6219  /* "cpartitioning.pyx":187
6220  * <int*>(quadraticNumbering_subdomain2global.data),
6221  * <double*>(quadratic_lagrangeNodes.data))
6222  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6223  * nDOF_subdomain,
6224  * max_dof_neighbors)
6225  */
6226  __Pyx_XDECREF(__pyx_r);
6227  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
6228  __Pyx_GOTREF(__pyx_t_1);
6229 
6230  /* "cpartitioning.pyx":188
6231  * <double*>(quadratic_lagrangeNodes.data))
6232  * return (nDOF_all_processes,
6233  * nDOF_subdomain, # <<<<<<<<<<<<<<
6234  * max_dof_neighbors)
6235  *
6236  */
6237  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
6238  __Pyx_GOTREF(__pyx_t_2);
6239 
6240  /* "cpartitioning.pyx":189
6241  * return (nDOF_all_processes,
6242  * nDOF_subdomain,
6243  * max_dof_neighbors) # <<<<<<<<<<<<<<
6244  *
6245  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm,
6246  */
6247  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error)
6248  __Pyx_GOTREF(__pyx_t_3);
6249 
6250  /* "cpartitioning.pyx":187
6251  * <int*>(quadraticNumbering_subdomain2global.data),
6252  * <double*>(quadratic_lagrangeNodes.data))
6253  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6254  * nDOF_subdomain,
6255  * max_dof_neighbors)
6256  */
6257  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
6258  __Pyx_GOTREF(__pyx_t_4);
6259  __Pyx_GIVEREF(__pyx_t_1);
6260  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6261  __Pyx_GIVEREF(__pyx_t_2);
6262  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
6263  __Pyx_GIVEREF(__pyx_t_3);
6264  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
6265  __pyx_t_1 = 0;
6266  __pyx_t_2 = 0;
6267  __pyx_t_3 = 0;
6268  __pyx_r = __pyx_t_4;
6269  __pyx_t_4 = 0;
6270  goto __pyx_L0;
6271 
6272  /* "cpartitioning.pyx":150
6273  * max_dof_neighbors)
6274  *
6275  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6276  * int nSpace,
6277  * cmeshTools.CMesh cmesh,
6278  */
6279 
6280  /* function exit code */
6281  __pyx_L1_error:;
6282  __Pyx_XDECREF(__pyx_t_1);
6283  __Pyx_XDECREF(__pyx_t_2);
6284  __Pyx_XDECREF(__pyx_t_3);
6285  __Pyx_XDECREF(__pyx_t_4);
6286  __Pyx_AddTraceback("cpartitioning.buildQuadraticCubeLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6287  __pyx_r = NULL;
6288  __pyx_L0:;
6289  __Pyx_XGIVEREF(__pyx_r);
6290  __Pyx_RefNannyFinishContext();
6291  return __pyx_r;
6292 }
6293 
6294 /* "cpartitioning.pyx":191
6295  * max_dof_neighbors)
6296  *
6297  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6298  * int nDOF_element,
6299  * cmeshTools.CMesh cmesh,
6300  */
6301 
6302 /* Python wrapper */
6303 static PyObject *__pyx_pw_13cpartitioning_13buildDiscontinuousGalerkinLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6304 static PyMethodDef __pyx_mdef_13cpartitioning_13buildDiscontinuousGalerkinLocal2GlobalMappings = {"buildDiscontinuousGalerkinLocal2GlobalMappings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_13buildDiscontinuousGalerkinLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
6305 static PyObject *__pyx_pw_13cpartitioning_13buildDiscontinuousGalerkinLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6306  struct PyMPICommObject *__pyx_v_comm = 0;
6307  int __pyx_v_nDOF_element;
6308  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
6309  CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
6310  PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
6311  PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
6312  PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned = 0;
6313  PyArrayObject *__pyx_v_dg_subdomain_l2g = 0;
6314  PyArrayObject *__pyx_v_dgNumbering_subdomain2global = 0;
6315  int __pyx_lineno = 0;
6316  const char *__pyx_filename = NULL;
6317  int __pyx_clineno = 0;
6318  PyObject *__pyx_r = 0;
6319  __Pyx_RefNannyDeclarations
6320  __Pyx_RefNannySetupContext("buildDiscontinuousGalerkinLocal2GlobalMappings (wrapper)", 0);
6321  {
6322  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nDOF_element,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_dg_dof_offsets_subdomain_owned,&__pyx_n_s_dg_subdomain_l2g,&__pyx_n_s_dgNumbering_subdomain2global,0};
6323  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
6324  if (unlikely(__pyx_kwds)) {
6325  Py_ssize_t kw_args;
6326  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6327  switch (pos_args) {
6328  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6329  CYTHON_FALLTHROUGH;
6330  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6331  CYTHON_FALLTHROUGH;
6332  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6333  CYTHON_FALLTHROUGH;
6334  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6335  CYTHON_FALLTHROUGH;
6336  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6337  CYTHON_FALLTHROUGH;
6338  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6339  CYTHON_FALLTHROUGH;
6340  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6341  CYTHON_FALLTHROUGH;
6342  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6343  CYTHON_FALLTHROUGH;
6344  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6345  CYTHON_FALLTHROUGH;
6346  case 0: break;
6347  default: goto __pyx_L5_argtuple_error;
6348  }
6349  kw_args = PyDict_Size(__pyx_kwds);
6350  switch (pos_args) {
6351  case 0:
6352  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
6353  else goto __pyx_L5_argtuple_error;
6354  CYTHON_FALLTHROUGH;
6355  case 1:
6356  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_element)) != 0)) kw_args--;
6357  else {
6358  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 1); __PYX_ERR(0, 191, __pyx_L3_error)
6359  }
6360  CYTHON_FALLTHROUGH;
6361  case 2:
6362  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
6363  else {
6364  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 2); __PYX_ERR(0, 191, __pyx_L3_error)
6365  }
6366  CYTHON_FALLTHROUGH;
6367  case 3:
6368  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
6369  else {
6370  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 3); __PYX_ERR(0, 191, __pyx_L3_error)
6371  }
6372  CYTHON_FALLTHROUGH;
6373  case 4:
6374  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
6375  else {
6376  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 4); __PYX_ERR(0, 191, __pyx_L3_error)
6377  }
6378  CYTHON_FALLTHROUGH;
6379  case 5:
6380  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
6381  else {
6382  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 5); __PYX_ERR(0, 191, __pyx_L3_error)
6383  }
6384  CYTHON_FALLTHROUGH;
6385  case 6:
6386  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dg_dof_offsets_subdomain_owned)) != 0)) kw_args--;
6387  else {
6388  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 6); __PYX_ERR(0, 191, __pyx_L3_error)
6389  }
6390  CYTHON_FALLTHROUGH;
6391  case 7:
6392  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dg_subdomain_l2g)) != 0)) kw_args--;
6393  else {
6394  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 7); __PYX_ERR(0, 191, __pyx_L3_error)
6395  }
6396  CYTHON_FALLTHROUGH;
6397  case 8:
6398  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dgNumbering_subdomain2global)) != 0)) kw_args--;
6399  else {
6400  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 8); __PYX_ERR(0, 191, __pyx_L3_error)
6401  }
6402  }
6403  if (unlikely(kw_args > 0)) {
6404  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildDiscontinuousGalerkinLocal2GlobalMappings") < 0)) __PYX_ERR(0, 191, __pyx_L3_error)
6405  }
6406  } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
6407  goto __pyx_L5_argtuple_error;
6408  } else {
6409  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6410  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6411  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6412  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6413  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6414  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6415  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6416  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6417  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6418  }
6419  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
6420  __pyx_v_nDOF_element = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nDOF_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 192, __pyx_L3_error)
6421  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
6422  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
6423  __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
6424  __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[5]);
6425  __pyx_v_dg_dof_offsets_subdomain_owned = ((PyArrayObject *)values[6]);
6426  __pyx_v_dg_subdomain_l2g = ((PyArrayObject *)values[7]);
6427  __pyx_v_dgNumbering_subdomain2global = ((PyArrayObject *)values[8]);
6428  }
6429  goto __pyx_L4_argument_unpacking_done;
6430  __pyx_L5_argtuple_error:;
6431  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 191, __pyx_L3_error)
6432  __pyx_L3_error:;
6433  __Pyx_AddTraceback("cpartitioning.buildDiscontinuousGalerkinLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6434  __Pyx_RefNannyFinishContext();
6435  return NULL;
6436  __pyx_L4_argument_unpacking_done:;
6437  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 191, __pyx_L1_error)
6438  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 193, __pyx_L1_error)
6439  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 194, __pyx_L1_error)
6440  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 195, __pyx_L1_error)
6441  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 196, __pyx_L1_error)
6442  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dg_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "dg_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 197, __pyx_L1_error)
6443  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dg_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1, "dg_subdomain_l2g", 0))) __PYX_ERR(0, 198, __pyx_L1_error)
6444  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dgNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "dgNumbering_subdomain2global", 0))) __PYX_ERR(0, 199, __pyx_L1_error)
6445  __pyx_r = __pyx_pf_13cpartitioning_12buildDiscontinuousGalerkinLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nDOF_element, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_dg_dof_offsets_subdomain_owned, __pyx_v_dg_subdomain_l2g, __pyx_v_dgNumbering_subdomain2global);
6446 
6447  /* function exit code */
6448  goto __pyx_L0;
6449  __pyx_L1_error:;
6450  __pyx_r = NULL;
6451  __pyx_L0:;
6452  __Pyx_RefNannyFinishContext();
6453  return __pyx_r;
6454 }
6455 
6456 static PyObject *__pyx_pf_13cpartitioning_12buildDiscontinuousGalerkinLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nDOF_element, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_dg_subdomain_l2g, PyArrayObject *__pyx_v_dgNumbering_subdomain2global) {
6457  int __pyx_v_nDOF_all_processes;
6458  int __pyx_v_nDOF_subdomain;
6459  int __pyx_v_max_dof_neighbors;
6460  PyObject *__pyx_r = NULL;
6461  __Pyx_RefNannyDeclarations
6462  PyObject *__pyx_t_1 = NULL;
6463  PyObject *__pyx_t_2 = NULL;
6464  PyObject *__pyx_t_3 = NULL;
6465  PyObject *__pyx_t_4 = NULL;
6466  int __pyx_lineno = 0;
6467  const char *__pyx_filename = NULL;
6468  int __pyx_clineno = 0;
6469  __Pyx_RefNannySetupContext("buildDiscontinuousGalerkinLocal2GlobalMappings", 0);
6470 
6471  /* "cpartitioning.pyx":200
6472  * np.ndarray dg_subdomain_l2g,
6473  * np.ndarray dgNumbering_subdomain2global):
6474  * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
6475  * cdef int nDOF_subdomain=0
6476  * cdef int max_dof_neighbors=0
6477  */
6478  __pyx_v_nDOF_all_processes = 0;
6479 
6480  /* "cpartitioning.pyx":201
6481  * np.ndarray dgNumbering_subdomain2global):
6482  * cdef int nDOF_all_processes=0
6483  * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
6484  * cdef int max_dof_neighbors=0
6485  * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi,
6486  */
6487  __pyx_v_nDOF_subdomain = 0;
6488 
6489  /* "cpartitioning.pyx":202
6490  * cdef int nDOF_all_processes=0
6491  * cdef int nDOF_subdomain=0
6492  * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
6493  * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi,
6494  * cmesh.mesh,
6495  */
6496  __pyx_v_max_dof_neighbors = 0;
6497 
6498  /* "cpartitioning.pyx":203
6499  * cdef int nDOF_subdomain=0
6500  * cdef int max_dof_neighbors=0
6501  * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi, # <<<<<<<<<<<<<<
6502  * cmesh.mesh,
6503  * <int*>(elementOffsets_subdomain_owned.data),
6504  */
6505  (void)(proteus::buildDiscontinuousGalerkinSubdomain2GlobalMappings(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_elementOffsets_subdomain_owned->data), ((int *)__pyx_v_elementNumbering_subdomain2global->data), __pyx_v_nDOF_element, __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_dg_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_dg_subdomain_l2g->data), ((int *)__pyx_v_dgNumbering_subdomain2global->data)));
6506 
6507  /* "cpartitioning.pyx":214
6508  * <int*>(dg_subdomain_l2g.data),
6509  * <int*>(dgNumbering_subdomain2global.data))
6510  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6511  * nDOF_subdomain,
6512  * max_dof_neighbors)
6513  */
6514  __Pyx_XDECREF(__pyx_r);
6515  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
6516  __Pyx_GOTREF(__pyx_t_1);
6517 
6518  /* "cpartitioning.pyx":215
6519  * <int*>(dgNumbering_subdomain2global.data))
6520  * return (nDOF_all_processes,
6521  * nDOF_subdomain, # <<<<<<<<<<<<<<
6522  * max_dof_neighbors)
6523  */
6524  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
6525  __Pyx_GOTREF(__pyx_t_2);
6526 
6527  /* "cpartitioning.pyx":216
6528  * return (nDOF_all_processes,
6529  * nDOF_subdomain,
6530  * max_dof_neighbors) # <<<<<<<<<<<<<<
6531  */
6532  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error)
6533  __Pyx_GOTREF(__pyx_t_3);
6534 
6535  /* "cpartitioning.pyx":214
6536  * <int*>(dg_subdomain_l2g.data),
6537  * <int*>(dgNumbering_subdomain2global.data))
6538  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6539  * nDOF_subdomain,
6540  * max_dof_neighbors)
6541  */
6542  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
6543  __Pyx_GOTREF(__pyx_t_4);
6544  __Pyx_GIVEREF(__pyx_t_1);
6545  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6546  __Pyx_GIVEREF(__pyx_t_2);
6547  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
6548  __Pyx_GIVEREF(__pyx_t_3);
6549  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
6550  __pyx_t_1 = 0;
6551  __pyx_t_2 = 0;
6552  __pyx_t_3 = 0;
6553  __pyx_r = __pyx_t_4;
6554  __pyx_t_4 = 0;
6555  goto __pyx_L0;
6556 
6557  /* "cpartitioning.pyx":191
6558  * max_dof_neighbors)
6559  *
6560  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6561  * int nDOF_element,
6562  * cmeshTools.CMesh cmesh,
6563  */
6564 
6565  /* function exit code */
6566  __pyx_L1_error:;
6567  __Pyx_XDECREF(__pyx_t_1);
6568  __Pyx_XDECREF(__pyx_t_2);
6569  __Pyx_XDECREF(__pyx_t_3);
6570  __Pyx_XDECREF(__pyx_t_4);
6571  __Pyx_AddTraceback("cpartitioning.buildDiscontinuousGalerkinLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6572  __pyx_r = NULL;
6573  __pyx_L0:;
6574  __Pyx_XGIVEREF(__pyx_r);
6575  __Pyx_RefNannyFinishContext();
6576  return __pyx_r;
6577 }
6578 
6579 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":742
6580  * ctypedef npy_cdouble complex_t
6581  *
6582  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6583  * return PyArray_MultiIterNew(1, <void*>a)
6584  *
6585  */
6586 
6587 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6588  PyObject *__pyx_r = NULL;
6589  __Pyx_RefNannyDeclarations
6590  PyObject *__pyx_t_1 = NULL;
6591  int __pyx_lineno = 0;
6592  const char *__pyx_filename = NULL;
6593  int __pyx_clineno = 0;
6594  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
6595 
6596  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":743
6597  *
6598  * cdef inline object PyArray_MultiIterNew1(a):
6599  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
6600  *
6601  * cdef inline object PyArray_MultiIterNew2(a, b):
6602  */
6603  __Pyx_XDECREF(__pyx_r);
6604  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 743, __pyx_L1_error)
6605  __Pyx_GOTREF(__pyx_t_1);
6606  __pyx_r = __pyx_t_1;
6607  __pyx_t_1 = 0;
6608  goto __pyx_L0;
6609 
6610  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":742
6611  * ctypedef npy_cdouble complex_t
6612  *
6613  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6614  * return PyArray_MultiIterNew(1, <void*>a)
6615  *
6616  */
6617 
6618  /* function exit code */
6619  __pyx_L1_error:;
6620  __Pyx_XDECREF(__pyx_t_1);
6621  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6622  __pyx_r = 0;
6623  __pyx_L0:;
6624  __Pyx_XGIVEREF(__pyx_r);
6625  __Pyx_RefNannyFinishContext();
6626  return __pyx_r;
6627 }
6628 
6629 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":745
6630  * return PyArray_MultiIterNew(1, <void*>a)
6631  *
6632  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6633  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6634  *
6635  */
6636 
6637 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6638  PyObject *__pyx_r = NULL;
6639  __Pyx_RefNannyDeclarations
6640  PyObject *__pyx_t_1 = NULL;
6641  int __pyx_lineno = 0;
6642  const char *__pyx_filename = NULL;
6643  int __pyx_clineno = 0;
6644  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
6645 
6646  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":746
6647  *
6648  * cdef inline object PyArray_MultiIterNew2(a, b):
6649  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
6650  *
6651  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6652  */
6653  __Pyx_XDECREF(__pyx_r);
6654  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 746, __pyx_L1_error)
6655  __Pyx_GOTREF(__pyx_t_1);
6656  __pyx_r = __pyx_t_1;
6657  __pyx_t_1 = 0;
6658  goto __pyx_L0;
6659 
6660  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":745
6661  * return PyArray_MultiIterNew(1, <void*>a)
6662  *
6663  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6664  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6665  *
6666  */
6667 
6668  /* function exit code */
6669  __pyx_L1_error:;
6670  __Pyx_XDECREF(__pyx_t_1);
6671  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6672  __pyx_r = 0;
6673  __pyx_L0:;
6674  __Pyx_XGIVEREF(__pyx_r);
6675  __Pyx_RefNannyFinishContext();
6676  return __pyx_r;
6677 }
6678 
6679 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":748
6680  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6681  *
6682  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6683  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6684  *
6685  */
6686 
6687 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6688  PyObject *__pyx_r = NULL;
6689  __Pyx_RefNannyDeclarations
6690  PyObject *__pyx_t_1 = NULL;
6691  int __pyx_lineno = 0;
6692  const char *__pyx_filename = NULL;
6693  int __pyx_clineno = 0;
6694  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
6695 
6696  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":749
6697  *
6698  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6699  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
6700  *
6701  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6702  */
6703  __Pyx_XDECREF(__pyx_r);
6704  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 749, __pyx_L1_error)
6705  __Pyx_GOTREF(__pyx_t_1);
6706  __pyx_r = __pyx_t_1;
6707  __pyx_t_1 = 0;
6708  goto __pyx_L0;
6709 
6710  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":748
6711  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6712  *
6713  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6714  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6715  *
6716  */
6717 
6718  /* function exit code */
6719  __pyx_L1_error:;
6720  __Pyx_XDECREF(__pyx_t_1);
6721  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6722  __pyx_r = 0;
6723  __pyx_L0:;
6724  __Pyx_XGIVEREF(__pyx_r);
6725  __Pyx_RefNannyFinishContext();
6726  return __pyx_r;
6727 }
6728 
6729 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":751
6730  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6731  *
6732  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6733  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6734  *
6735  */
6736 
6737 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
6738  PyObject *__pyx_r = NULL;
6739  __Pyx_RefNannyDeclarations
6740  PyObject *__pyx_t_1 = NULL;
6741  int __pyx_lineno = 0;
6742  const char *__pyx_filename = NULL;
6743  int __pyx_clineno = 0;
6744  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
6745 
6746  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":752
6747  *
6748  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6749  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
6750  *
6751  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6752  */
6753  __Pyx_XDECREF(__pyx_r);
6754  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 752, __pyx_L1_error)
6755  __Pyx_GOTREF(__pyx_t_1);
6756  __pyx_r = __pyx_t_1;
6757  __pyx_t_1 = 0;
6758  goto __pyx_L0;
6759 
6760  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":751
6761  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6762  *
6763  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6764  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6765  *
6766  */
6767 
6768  /* function exit code */
6769  __pyx_L1_error:;
6770  __Pyx_XDECREF(__pyx_t_1);
6771  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6772  __pyx_r = 0;
6773  __pyx_L0:;
6774  __Pyx_XGIVEREF(__pyx_r);
6775  __Pyx_RefNannyFinishContext();
6776  return __pyx_r;
6777 }
6778 
6779 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":754
6780  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6781  *
6782  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6783  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6784  *
6785  */
6786 
6787 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
6788  PyObject *__pyx_r = NULL;
6789  __Pyx_RefNannyDeclarations
6790  PyObject *__pyx_t_1 = NULL;
6791  int __pyx_lineno = 0;
6792  const char *__pyx_filename = NULL;
6793  int __pyx_clineno = 0;
6794  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
6795 
6796  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":755
6797  *
6798  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6799  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
6800  *
6801  * cdef inline tuple PyDataType_SHAPE(dtype d):
6802  */
6803  __Pyx_XDECREF(__pyx_r);
6804  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 755, __pyx_L1_error)
6805  __Pyx_GOTREF(__pyx_t_1);
6806  __pyx_r = __pyx_t_1;
6807  __pyx_t_1 = 0;
6808  goto __pyx_L0;
6809 
6810  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":754
6811  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6812  *
6813  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6814  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6815  *
6816  */
6817 
6818  /* function exit code */
6819  __pyx_L1_error:;
6820  __Pyx_XDECREF(__pyx_t_1);
6821  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6822  __pyx_r = 0;
6823  __pyx_L0:;
6824  __Pyx_XGIVEREF(__pyx_r);
6825  __Pyx_RefNannyFinishContext();
6826  return __pyx_r;
6827 }
6828 
6829 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":757
6830  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6831  *
6832  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6833  * if PyDataType_HASSUBARRAY(d):
6834  * return <tuple>d.subarray.shape
6835  */
6836 
6837 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6838  PyObject *__pyx_r = NULL;
6839  __Pyx_RefNannyDeclarations
6840  int __pyx_t_1;
6841  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
6842 
6843  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":758
6844  *
6845  * cdef inline tuple PyDataType_SHAPE(dtype d):
6846  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6847  * return <tuple>d.subarray.shape
6848  * else:
6849  */
6850  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6851  if (__pyx_t_1) {
6852 
6853  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":759
6854  * cdef inline tuple PyDataType_SHAPE(dtype d):
6855  * if PyDataType_HASSUBARRAY(d):
6856  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
6857  * else:
6858  * return ()
6859  */
6860  __Pyx_XDECREF(__pyx_r);
6861  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6862  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6863  goto __pyx_L0;
6864 
6865  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":758
6866  *
6867  * cdef inline tuple PyDataType_SHAPE(dtype d):
6868  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6869  * return <tuple>d.subarray.shape
6870  * else:
6871  */
6872  }
6873 
6874  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":761
6875  * return <tuple>d.subarray.shape
6876  * else:
6877  * return () # <<<<<<<<<<<<<<
6878  *
6879  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
6880  */
6881  /*else*/ {
6882  __Pyx_XDECREF(__pyx_r);
6883  __Pyx_INCREF(__pyx_empty_tuple);
6884  __pyx_r = __pyx_empty_tuple;
6885  goto __pyx_L0;
6886  }
6887 
6888  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":757
6889  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6890  *
6891  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6892  * if PyDataType_HASSUBARRAY(d):
6893  * return <tuple>d.subarray.shape
6894  */
6895 
6896  /* function exit code */
6897  __pyx_L0:;
6898  __Pyx_XGIVEREF(__pyx_r);
6899  __Pyx_RefNannyFinishContext();
6900  return __pyx_r;
6901 }
6902 
6903 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":763
6904  * return ()
6905  *
6906  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
6907  * # Recursive utility function used in __getbuffer__ to get format
6908  * # string. The new location in the format string is returned.
6909  */
6910 
6911 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
6912  PyArray_Descr *__pyx_v_child = 0;
6913  int __pyx_v_endian_detector;
6914  int __pyx_v_little_endian;
6915  PyObject *__pyx_v_fields = 0;
6916  PyObject *__pyx_v_childname = NULL;
6917  PyObject *__pyx_v_new_offset = NULL;
6918  PyObject *__pyx_v_t = NULL;
6919  char *__pyx_r;
6920  __Pyx_RefNannyDeclarations
6921  PyObject *__pyx_t_1 = NULL;
6922  Py_ssize_t __pyx_t_2;
6923  PyObject *__pyx_t_3 = NULL;
6924  PyObject *__pyx_t_4 = NULL;
6925  int __pyx_t_5;
6926  int __pyx_t_6;
6927  int __pyx_t_7;
6928  long __pyx_t_8;
6929  char *__pyx_t_9;
6930  int __pyx_lineno = 0;
6931  const char *__pyx_filename = NULL;
6932  int __pyx_clineno = 0;
6933  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
6934 
6935  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":768
6936  *
6937  * cdef dtype child
6938  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
6939  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6940  * cdef tuple fields
6941  */
6942  __pyx_v_endian_detector = 1;
6943 
6944  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":769
6945  * cdef dtype child
6946  * cdef int endian_detector = 1
6947  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
6948  * cdef tuple fields
6949  *
6950  */
6951  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
6952 
6953  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":772
6954  * cdef tuple fields
6955  *
6956  * for childname in descr.names: # <<<<<<<<<<<<<<
6957  * fields = descr.fields[childname]
6958  * child, new_offset = fields
6959  */
6960  if (unlikely(__pyx_v_descr->names == Py_None)) {
6961  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
6962  __PYX_ERR(1, 772, __pyx_L1_error)
6963  }
6964  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
6965  for (;;) {
6966  if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
6967  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6968  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 772, __pyx_L1_error)
6969  #else
6970  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 772, __pyx_L1_error)
6971  __Pyx_GOTREF(__pyx_t_3);
6972  #endif
6973  __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
6974  __pyx_t_3 = 0;
6975 
6976  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":773
6977  *
6978  * for childname in descr.names:
6979  * fields = descr.fields[childname] # <<<<<<<<<<<<<<
6980  * child, new_offset = fields
6981  *
6982  */
6983  if (unlikely(__pyx_v_descr->fields == Py_None)) {
6984  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6985  __PYX_ERR(1, 773, __pyx_L1_error)
6986  }
6987  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 773, __pyx_L1_error)
6988  __Pyx_GOTREF(__pyx_t_3);
6989  if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 773, __pyx_L1_error)
6990  __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
6991  __pyx_t_3 = 0;
6992 
6993  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":774
6994  * for childname in descr.names:
6995  * fields = descr.fields[childname]
6996  * child, new_offset = fields # <<<<<<<<<<<<<<
6997  *
6998  * if (end - f) - <int>(new_offset - offset[0]) < 15:
6999  */
7000  if (likely(__pyx_v_fields != Py_None)) {
7001  PyObject* sequence = __pyx_v_fields;
7002  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7003  if (unlikely(size != 2)) {
7004  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7005  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7006  __PYX_ERR(1, 774, __pyx_L1_error)
7007  }
7008  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7009  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7010  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
7011  __Pyx_INCREF(__pyx_t_3);
7012  __Pyx_INCREF(__pyx_t_4);
7013  #else
7014  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 774, __pyx_L1_error)
7015  __Pyx_GOTREF(__pyx_t_3);
7016  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 774, __pyx_L1_error)
7017  __Pyx_GOTREF(__pyx_t_4);
7018  #endif
7019  } else {
7020  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 774, __pyx_L1_error)
7021  }
7022  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 774, __pyx_L1_error)
7023  __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
7024  __pyx_t_3 = 0;
7025  __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
7026  __pyx_t_4 = 0;
7027 
7028  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":776
7029  * child, new_offset = fields
7030  *
7031  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7032  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7033  *
7034  */
7035  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 776, __pyx_L1_error)
7036  __Pyx_GOTREF(__pyx_t_4);
7037  __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 776, __pyx_L1_error)
7038  __Pyx_GOTREF(__pyx_t_3);
7039  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7040  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 776, __pyx_L1_error)
7041  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7042  __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
7043  if (unlikely(__pyx_t_6)) {
7044 
7045  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":777
7046  *
7047  * if (end - f) - <int>(new_offset - offset[0]) < 15:
7048  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
7049  *
7050  * if ((child.byteorder == c'>' and little_endian) or
7051  */
7052  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
7053  __Pyx_GOTREF(__pyx_t_3);
7054  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7055  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7056  __PYX_ERR(1, 777, __pyx_L1_error)
7057 
7058  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":776
7059  * child, new_offset = fields
7060  *
7061  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7062  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7063  *
7064  */
7065  }
7066 
7067  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":779
7068  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7069  *
7070  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7071  * (child.byteorder == c'<' and not little_endian)):
7072  * raise ValueError(u"Non-native byte order not supported")
7073  */
7074  __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
7075  if (!__pyx_t_7) {
7076  goto __pyx_L8_next_or;
7077  } else {
7078  }
7079  __pyx_t_7 = (__pyx_v_little_endian != 0);
7080  if (!__pyx_t_7) {
7081  } else {
7082  __pyx_t_6 = __pyx_t_7;
7083  goto __pyx_L7_bool_binop_done;
7084  }
7085  __pyx_L8_next_or:;
7086 
7087  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":780
7088  *
7089  * if ((child.byteorder == c'>' and little_endian) or
7090  * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
7091  * raise ValueError(u"Non-native byte order not supported")
7092  * # One could encode it in the format string and have Cython
7093  */
7094  __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
7095  if (__pyx_t_7) {
7096  } else {
7097  __pyx_t_6 = __pyx_t_7;
7098  goto __pyx_L7_bool_binop_done;
7099  }
7100  __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
7101  __pyx_t_6 = __pyx_t_7;
7102  __pyx_L7_bool_binop_done:;
7103 
7104  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":779
7105  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7106  *
7107  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7108  * (child.byteorder == c'<' and not little_endian)):
7109  * raise ValueError(u"Non-native byte order not supported")
7110  */
7111  if (unlikely(__pyx_t_6)) {
7112 
7113  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":781
7114  * if ((child.byteorder == c'>' and little_endian) or
7115  * (child.byteorder == c'<' and not little_endian)):
7116  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
7117  * # One could encode it in the format string and have Cython
7118  * # complain instead, BUT: < and > in format strings also imply
7119  */
7120  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 781, __pyx_L1_error)
7121  __Pyx_GOTREF(__pyx_t_3);
7122  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7123  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7124  __PYX_ERR(1, 781, __pyx_L1_error)
7125 
7126  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":779
7127  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7128  *
7129  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7130  * (child.byteorder == c'<' and not little_endian)):
7131  * raise ValueError(u"Non-native byte order not supported")
7132  */
7133  }
7134 
7135  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":791
7136  *
7137  * # Output padding bytes
7138  * while offset[0] < new_offset: # <<<<<<<<<<<<<<
7139  * f[0] = 120 # "x"; pad byte
7140  * f += 1
7141  */
7142  while (1) {
7143  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 791, __pyx_L1_error)
7144  __Pyx_GOTREF(__pyx_t_3);
7145  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 791, __pyx_L1_error)
7146  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7147  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 791, __pyx_L1_error)
7148  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7149  if (!__pyx_t_6) break;
7150 
7151  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":792
7152  * # Output padding bytes
7153  * while offset[0] < new_offset:
7154  * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
7155  * f += 1
7156  * offset[0] += 1
7157  */
7158  (__pyx_v_f[0]) = 0x78;
7159 
7160  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":793
7161  * while offset[0] < new_offset:
7162  * f[0] = 120 # "x"; pad byte
7163  * f += 1 # <<<<<<<<<<<<<<
7164  * offset[0] += 1
7165  *
7166  */
7167  __pyx_v_f = (__pyx_v_f + 1);
7168 
7169  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":794
7170  * f[0] = 120 # "x"; pad byte
7171  * f += 1
7172  * offset[0] += 1 # <<<<<<<<<<<<<<
7173  *
7174  * offset[0] += child.itemsize
7175  */
7176  __pyx_t_8 = 0;
7177  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
7178  }
7179 
7180  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":796
7181  * offset[0] += 1
7182  *
7183  * offset[0] += child.itemsize # <<<<<<<<<<<<<<
7184  *
7185  * if not PyDataType_HASFIELDS(child):
7186  */
7187  __pyx_t_8 = 0;
7188  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
7189 
7190  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":798
7191  * offset[0] += child.itemsize
7192  *
7193  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
7194  * t = child.type_num
7195  * if end - f < 5:
7196  */
7197  __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
7198  if (__pyx_t_6) {
7199 
7200  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":799
7201  *
7202  * if not PyDataType_HASFIELDS(child):
7203  * t = child.type_num # <<<<<<<<<<<<<<
7204  * if end - f < 5:
7205  * raise RuntimeError(u"Format string allocated too short.")
7206  */
7207  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 799, __pyx_L1_error)
7208  __Pyx_GOTREF(__pyx_t_4);
7209  __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
7210  __pyx_t_4 = 0;
7211 
7212  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":800
7213  * if not PyDataType_HASFIELDS(child):
7214  * t = child.type_num
7215  * if end - f < 5: # <<<<<<<<<<<<<<
7216  * raise RuntimeError(u"Format string allocated too short.")
7217  *
7218  */
7219  __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
7220  if (unlikely(__pyx_t_6)) {
7221 
7222  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":801
7223  * t = child.type_num
7224  * if end - f < 5:
7225  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
7226  *
7227  * # Until ticket #99 is fixed, use integers to avoid warnings
7228  */
7229  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 801, __pyx_L1_error)
7230  __Pyx_GOTREF(__pyx_t_4);
7231  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7232  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7233  __PYX_ERR(1, 801, __pyx_L1_error)
7234 
7235  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":800
7236  * if not PyDataType_HASFIELDS(child):
7237  * t = child.type_num
7238  * if end - f < 5: # <<<<<<<<<<<<<<
7239  * raise RuntimeError(u"Format string allocated too short.")
7240  *
7241  */
7242  }
7243 
7244  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":804
7245  *
7246  * # Until ticket #99 is fixed, use integers to avoid warnings
7247  * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
7248  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7249  * elif t == NPY_SHORT: f[0] = 104 #"h"
7250  */
7251  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 804, __pyx_L1_error)
7252  __Pyx_GOTREF(__pyx_t_4);
7253  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 804, __pyx_L1_error)
7254  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7255  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 804, __pyx_L1_error)
7256  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7257  if (__pyx_t_6) {
7258  (__pyx_v_f[0]) = 98;
7259  goto __pyx_L15;
7260  }
7261 
7262  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":805
7263  * # Until ticket #99 is fixed, use integers to avoid warnings
7264  * if t == NPY_BYTE: f[0] = 98 #"b"
7265  * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
7266  * elif t == NPY_SHORT: f[0] = 104 #"h"
7267  * elif t == NPY_USHORT: f[0] = 72 #"H"
7268  */
7269  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 805, __pyx_L1_error)
7270  __Pyx_GOTREF(__pyx_t_3);
7271  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 805, __pyx_L1_error)
7272  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7273  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 805, __pyx_L1_error)
7274  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7275  if (__pyx_t_6) {
7276  (__pyx_v_f[0]) = 66;
7277  goto __pyx_L15;
7278  }
7279 
7280  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":806
7281  * if t == NPY_BYTE: f[0] = 98 #"b"
7282  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7283  * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
7284  * elif t == NPY_USHORT: f[0] = 72 #"H"
7285  * elif t == NPY_INT: f[0] = 105 #"i"
7286  */
7287  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 806, __pyx_L1_error)
7288  __Pyx_GOTREF(__pyx_t_4);
7289  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 806, __pyx_L1_error)
7290  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7291  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 806, __pyx_L1_error)
7292  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7293  if (__pyx_t_6) {
7294  (__pyx_v_f[0]) = 0x68;
7295  goto __pyx_L15;
7296  }
7297 
7298  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":807
7299  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7300  * elif t == NPY_SHORT: f[0] = 104 #"h"
7301  * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
7302  * elif t == NPY_INT: f[0] = 105 #"i"
7303  * elif t == NPY_UINT: f[0] = 73 #"I"
7304  */
7305  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 807, __pyx_L1_error)
7306  __Pyx_GOTREF(__pyx_t_3);
7307  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 807, __pyx_L1_error)
7308  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7309  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 807, __pyx_L1_error)
7310  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7311  if (__pyx_t_6) {
7312  (__pyx_v_f[0]) = 72;
7313  goto __pyx_L15;
7314  }
7315 
7316  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":808
7317  * elif t == NPY_SHORT: f[0] = 104 #"h"
7318  * elif t == NPY_USHORT: f[0] = 72 #"H"
7319  * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
7320  * elif t == NPY_UINT: f[0] = 73 #"I"
7321  * elif t == NPY_LONG: f[0] = 108 #"l"
7322  */
7323  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 808, __pyx_L1_error)
7324  __Pyx_GOTREF(__pyx_t_4);
7325  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 808, __pyx_L1_error)
7326  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7327  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 808, __pyx_L1_error)
7328  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7329  if (__pyx_t_6) {
7330  (__pyx_v_f[0]) = 0x69;
7331  goto __pyx_L15;
7332  }
7333 
7334  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":809
7335  * elif t == NPY_USHORT: f[0] = 72 #"H"
7336  * elif t == NPY_INT: f[0] = 105 #"i"
7337  * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
7338  * elif t == NPY_LONG: f[0] = 108 #"l"
7339  * elif t == NPY_ULONG: f[0] = 76 #"L"
7340  */
7341  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 809, __pyx_L1_error)
7342  __Pyx_GOTREF(__pyx_t_3);
7343  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 809, __pyx_L1_error)
7344  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7345  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 809, __pyx_L1_error)
7346  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7347  if (__pyx_t_6) {
7348  (__pyx_v_f[0]) = 73;
7349  goto __pyx_L15;
7350  }
7351 
7352  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":810
7353  * elif t == NPY_INT: f[0] = 105 #"i"
7354  * elif t == NPY_UINT: f[0] = 73 #"I"
7355  * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
7356  * elif t == NPY_ULONG: f[0] = 76 #"L"
7357  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7358  */
7359  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 810, __pyx_L1_error)
7360  __Pyx_GOTREF(__pyx_t_4);
7361  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 810, __pyx_L1_error)
7362  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7363  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 810, __pyx_L1_error)
7364  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7365  if (__pyx_t_6) {
7366  (__pyx_v_f[0]) = 0x6C;
7367  goto __pyx_L15;
7368  }
7369 
7370  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":811
7371  * elif t == NPY_UINT: f[0] = 73 #"I"
7372  * elif t == NPY_LONG: f[0] = 108 #"l"
7373  * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
7374  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7375  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7376  */
7377  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 811, __pyx_L1_error)
7378  __Pyx_GOTREF(__pyx_t_3);
7379  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 811, __pyx_L1_error)
7380  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7381  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 811, __pyx_L1_error)
7382  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7383  if (__pyx_t_6) {
7384  (__pyx_v_f[0]) = 76;
7385  goto __pyx_L15;
7386  }
7387 
7388  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":812
7389  * elif t == NPY_LONG: f[0] = 108 #"l"
7390  * elif t == NPY_ULONG: f[0] = 76 #"L"
7391  * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
7392  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7393  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7394  */
7395  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 812, __pyx_L1_error)
7396  __Pyx_GOTREF(__pyx_t_4);
7397  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 812, __pyx_L1_error)
7398  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7399  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 812, __pyx_L1_error)
7400  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7401  if (__pyx_t_6) {
7402  (__pyx_v_f[0]) = 0x71;
7403  goto __pyx_L15;
7404  }
7405 
7406  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":813
7407  * elif t == NPY_ULONG: f[0] = 76 #"L"
7408  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7409  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
7410  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7411  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7412  */
7413  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error)
7414  __Pyx_GOTREF(__pyx_t_3);
7415  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error)
7416  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7417  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error)
7418  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7419  if (__pyx_t_6) {
7420  (__pyx_v_f[0]) = 81;
7421  goto __pyx_L15;
7422  }
7423 
7424  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":814
7425  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7426  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7427  * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
7428  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7429  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7430  */
7431  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 814, __pyx_L1_error)
7432  __Pyx_GOTREF(__pyx_t_4);
7433  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 814, __pyx_L1_error)
7434  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7435  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 814, __pyx_L1_error)
7436  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7437  if (__pyx_t_6) {
7438  (__pyx_v_f[0]) = 0x66;
7439  goto __pyx_L15;
7440  }
7441 
7442  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":815
7443  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7444  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7445  * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
7446  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7447  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7448  */
7449  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 815, __pyx_L1_error)
7450  __Pyx_GOTREF(__pyx_t_3);
7451  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 815, __pyx_L1_error)
7452  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7453  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 815, __pyx_L1_error)
7454  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7455  if (__pyx_t_6) {
7456  (__pyx_v_f[0]) = 0x64;
7457  goto __pyx_L15;
7458  }
7459 
7460  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":816
7461  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7462  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7463  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
7464  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7465  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7466  */
7467  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 816, __pyx_L1_error)
7468  __Pyx_GOTREF(__pyx_t_4);
7469  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 816, __pyx_L1_error)
7470  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7471  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 816, __pyx_L1_error)
7472  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7473  if (__pyx_t_6) {
7474  (__pyx_v_f[0]) = 0x67;
7475  goto __pyx_L15;
7476  }
7477 
7478  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":817
7479  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7480  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7481  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
7482  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7483  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7484  */
7485  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 817, __pyx_L1_error)
7486  __Pyx_GOTREF(__pyx_t_3);
7487  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 817, __pyx_L1_error)
7488  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7489  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 817, __pyx_L1_error)
7490  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7491  if (__pyx_t_6) {
7492  (__pyx_v_f[0]) = 90;
7493  (__pyx_v_f[1]) = 0x66;
7494  __pyx_v_f = (__pyx_v_f + 1);
7495  goto __pyx_L15;
7496  }
7497 
7498  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":818
7499  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7500  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7501  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
7502  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7503  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7504  */
7505  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 818, __pyx_L1_error)
7506  __Pyx_GOTREF(__pyx_t_4);
7507  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 818, __pyx_L1_error)
7508  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7509  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 818, __pyx_L1_error)
7510  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7511  if (__pyx_t_6) {
7512  (__pyx_v_f[0]) = 90;
7513  (__pyx_v_f[1]) = 0x64;
7514  __pyx_v_f = (__pyx_v_f + 1);
7515  goto __pyx_L15;
7516  }
7517 
7518  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":819
7519  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7520  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7521  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
7522  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7523  * else:
7524  */
7525  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 819, __pyx_L1_error)
7526  __Pyx_GOTREF(__pyx_t_3);
7527  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 819, __pyx_L1_error)
7528  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7529  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 819, __pyx_L1_error)
7530  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7531  if (__pyx_t_6) {
7532  (__pyx_v_f[0]) = 90;
7533  (__pyx_v_f[1]) = 0x67;
7534  __pyx_v_f = (__pyx_v_f + 1);
7535  goto __pyx_L15;
7536  }
7537 
7538  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":820
7539  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7540  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7541  * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
7542  * else:
7543  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7544  */
7545  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 820, __pyx_L1_error)
7546  __Pyx_GOTREF(__pyx_t_4);
7547  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 820, __pyx_L1_error)
7548  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7549  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 820, __pyx_L1_error)
7550  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7551  if (likely(__pyx_t_6)) {
7552  (__pyx_v_f[0]) = 79;
7553  goto __pyx_L15;
7554  }
7555 
7556  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":822
7557  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7558  * else:
7559  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
7560  * f += 1
7561  * else:
7562  */
7563  /*else*/ {
7564  __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 822, __pyx_L1_error)
7565  __Pyx_GOTREF(__pyx_t_3);
7566  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 822, __pyx_L1_error)
7567  __Pyx_GOTREF(__pyx_t_4);
7568  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7569  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7570  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7571  __PYX_ERR(1, 822, __pyx_L1_error)
7572  }
7573  __pyx_L15:;
7574 
7575  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":823
7576  * else:
7577  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7578  * f += 1 # <<<<<<<<<<<<<<
7579  * else:
7580  * # Cython ignores struct boundary information ("T{...}"),
7581  */
7582  __pyx_v_f = (__pyx_v_f + 1);
7583 
7584  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":798
7585  * offset[0] += child.itemsize
7586  *
7587  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
7588  * t = child.type_num
7589  * if end - f < 5:
7590  */
7591  goto __pyx_L13;
7592  }
7593 
7594  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":827
7595  * # Cython ignores struct boundary information ("T{...}"),
7596  * # so don't output it
7597  * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
7598  * return f
7599  *
7600  */
7601  /*else*/ {
7602  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 827, __pyx_L1_error)
7603  __pyx_v_f = __pyx_t_9;
7604  }
7605  __pyx_L13:;
7606 
7607  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":772
7608  * cdef tuple fields
7609  *
7610  * for childname in descr.names: # <<<<<<<<<<<<<<
7611  * fields = descr.fields[childname]
7612  * child, new_offset = fields
7613  */
7614  }
7615  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7616 
7617  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":828
7618  * # so don't output it
7619  * f = _util_dtypestring(child, f, end, offset)
7620  * return f # <<<<<<<<<<<<<<
7621  *
7622  *
7623  */
7624  __pyx_r = __pyx_v_f;
7625  goto __pyx_L0;
7626 
7627  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":763
7628  * return ()
7629  *
7630  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
7631  * # Recursive utility function used in __getbuffer__ to get format
7632  * # string. The new location in the format string is returned.
7633  */
7634 
7635  /* function exit code */
7636  __pyx_L1_error:;
7637  __Pyx_XDECREF(__pyx_t_1);
7638  __Pyx_XDECREF(__pyx_t_3);
7639  __Pyx_XDECREF(__pyx_t_4);
7640  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
7641  __pyx_r = NULL;
7642  __pyx_L0:;
7643  __Pyx_XDECREF((PyObject *)__pyx_v_child);
7644  __Pyx_XDECREF(__pyx_v_fields);
7645  __Pyx_XDECREF(__pyx_v_childname);
7646  __Pyx_XDECREF(__pyx_v_new_offset);
7647  __Pyx_XDECREF(__pyx_v_t);
7648  __Pyx_RefNannyFinishContext();
7649  return __pyx_r;
7650 }
7651 
7652 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":943
7653  * int _import_umath() except -1
7654  *
7655  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7656  * Py_INCREF(base) # important to do this before stealing the reference below!
7657  * PyArray_SetBaseObject(arr, base)
7658  */
7659 
7660 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7661  __Pyx_RefNannyDeclarations
7662  __Pyx_RefNannySetupContext("set_array_base", 0);
7663 
7664  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":944
7665  *
7666  * cdef inline void set_array_base(ndarray arr, object base):
7667  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
7668  * PyArray_SetBaseObject(arr, base)
7669  *
7670  */
7671  Py_INCREF(__pyx_v_base);
7672 
7673  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":945
7674  * cdef inline void set_array_base(ndarray arr, object base):
7675  * Py_INCREF(base) # important to do this before stealing the reference below!
7676  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
7677  *
7678  * cdef inline object get_array_base(ndarray arr):
7679  */
7680  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
7681 
7682  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":943
7683  * int _import_umath() except -1
7684  *
7685  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7686  * Py_INCREF(base) # important to do this before stealing the reference below!
7687  * PyArray_SetBaseObject(arr, base)
7688  */
7689 
7690  /* function exit code */
7691  __Pyx_RefNannyFinishContext();
7692 }
7693 
7694 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":947
7695  * PyArray_SetBaseObject(arr, base)
7696  *
7697  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7698  * base = PyArray_BASE(arr)
7699  * if base is NULL:
7700  */
7701 
7702 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7703  PyObject *__pyx_v_base;
7704  PyObject *__pyx_r = NULL;
7705  __Pyx_RefNannyDeclarations
7706  int __pyx_t_1;
7707  __Pyx_RefNannySetupContext("get_array_base", 0);
7708 
7709  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":948
7710  *
7711  * cdef inline object get_array_base(ndarray arr):
7712  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
7713  * if base is NULL:
7714  * return None
7715  */
7716  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
7717 
7718  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":949
7719  * cdef inline object get_array_base(ndarray arr):
7720  * base = PyArray_BASE(arr)
7721  * if base is NULL: # <<<<<<<<<<<<<<
7722  * return None
7723  * return <object>base
7724  */
7725  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7726  if (__pyx_t_1) {
7727 
7728  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":950
7729  * base = PyArray_BASE(arr)
7730  * if base is NULL:
7731  * return None # <<<<<<<<<<<<<<
7732  * return <object>base
7733  *
7734  */
7735  __Pyx_XDECREF(__pyx_r);
7736  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7737  goto __pyx_L0;
7738 
7739  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":949
7740  * cdef inline object get_array_base(ndarray arr):
7741  * base = PyArray_BASE(arr)
7742  * if base is NULL: # <<<<<<<<<<<<<<
7743  * return None
7744  * return <object>base
7745  */
7746  }
7747 
7748  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":951
7749  * if base is NULL:
7750  * return None
7751  * return <object>base # <<<<<<<<<<<<<<
7752  *
7753  * # Versions of the import_* functions which are more suitable for
7754  */
7755  __Pyx_XDECREF(__pyx_r);
7756  __Pyx_INCREF(((PyObject *)__pyx_v_base));
7757  __pyx_r = ((PyObject *)__pyx_v_base);
7758  goto __pyx_L0;
7759 
7760  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":947
7761  * PyArray_SetBaseObject(arr, base)
7762  *
7763  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7764  * base = PyArray_BASE(arr)
7765  * if base is NULL:
7766  */
7767 
7768  /* function exit code */
7769  __pyx_L0:;
7770  __Pyx_XGIVEREF(__pyx_r);
7771  __Pyx_RefNannyFinishContext();
7772  return __pyx_r;
7773 }
7774 
7775 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":955
7776  * # Versions of the import_* functions which are more suitable for
7777  * # Cython code.
7778  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7779  * try:
7780  * __pyx_import_array()
7781  */
7782 
7783 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
7784  int __pyx_r;
7785  __Pyx_RefNannyDeclarations
7786  PyObject *__pyx_t_1 = NULL;
7787  PyObject *__pyx_t_2 = NULL;
7788  PyObject *__pyx_t_3 = NULL;
7789  int __pyx_t_4;
7790  PyObject *__pyx_t_5 = NULL;
7791  PyObject *__pyx_t_6 = NULL;
7792  PyObject *__pyx_t_7 = NULL;
7793  PyObject *__pyx_t_8 = NULL;
7794  int __pyx_lineno = 0;
7795  const char *__pyx_filename = NULL;
7796  int __pyx_clineno = 0;
7797  __Pyx_RefNannySetupContext("import_array", 0);
7798 
7799  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":956
7800  * # Cython code.
7801  * cdef inline int import_array() except -1:
7802  * try: # <<<<<<<<<<<<<<
7803  * __pyx_import_array()
7804  * except Exception:
7805  */
7806  {
7807  __Pyx_PyThreadState_declare
7808  __Pyx_PyThreadState_assign
7809  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7810  __Pyx_XGOTREF(__pyx_t_1);
7811  __Pyx_XGOTREF(__pyx_t_2);
7812  __Pyx_XGOTREF(__pyx_t_3);
7813  /*try:*/ {
7814 
7815  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":957
7816  * cdef inline int import_array() except -1:
7817  * try:
7818  * __pyx_import_array() # <<<<<<<<<<<<<<
7819  * except Exception:
7820  * raise ImportError("numpy.core.multiarray failed to import")
7821  */
7822  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L3_error)
7823 
7824  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":956
7825  * # Cython code.
7826  * cdef inline int import_array() except -1:
7827  * try: # <<<<<<<<<<<<<<
7828  * __pyx_import_array()
7829  * except Exception:
7830  */
7831  }
7832  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7833  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7834  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7835  goto __pyx_L8_try_end;
7836  __pyx_L3_error:;
7837 
7838  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":958
7839  * try:
7840  * __pyx_import_array()
7841  * except Exception: # <<<<<<<<<<<<<<
7842  * raise ImportError("numpy.core.multiarray failed to import")
7843  *
7844  */
7845  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7846  if (__pyx_t_4) {
7847  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7848  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 958, __pyx_L5_except_error)
7849  __Pyx_GOTREF(__pyx_t_5);
7850  __Pyx_GOTREF(__pyx_t_6);
7851  __Pyx_GOTREF(__pyx_t_7);
7852 
7853  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":959
7854  * __pyx_import_array()
7855  * except Exception:
7856  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
7857  *
7858  * cdef inline int import_umath() except -1:
7859  */
7860  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 959, __pyx_L5_except_error)
7861  __Pyx_GOTREF(__pyx_t_8);
7862  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7863  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7864  __PYX_ERR(1, 959, __pyx_L5_except_error)
7865  }
7866  goto __pyx_L5_except_error;
7867  __pyx_L5_except_error:;
7868 
7869  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":956
7870  * # Cython code.
7871  * cdef inline int import_array() except -1:
7872  * try: # <<<<<<<<<<<<<<
7873  * __pyx_import_array()
7874  * except Exception:
7875  */
7876  __Pyx_XGIVEREF(__pyx_t_1);
7877  __Pyx_XGIVEREF(__pyx_t_2);
7878  __Pyx_XGIVEREF(__pyx_t_3);
7879  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7880  goto __pyx_L1_error;
7881  __pyx_L8_try_end:;
7882  }
7883 
7884  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":955
7885  * # Versions of the import_* functions which are more suitable for
7886  * # Cython code.
7887  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7888  * try:
7889  * __pyx_import_array()
7890  */
7891 
7892  /* function exit code */
7893  __pyx_r = 0;
7894  goto __pyx_L0;
7895  __pyx_L1_error:;
7896  __Pyx_XDECREF(__pyx_t_5);
7897  __Pyx_XDECREF(__pyx_t_6);
7898  __Pyx_XDECREF(__pyx_t_7);
7899  __Pyx_XDECREF(__pyx_t_8);
7900  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7901  __pyx_r = -1;
7902  __pyx_L0:;
7903  __Pyx_RefNannyFinishContext();
7904  return __pyx_r;
7905 }
7906 
7907 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":961
7908  * raise ImportError("numpy.core.multiarray failed to import")
7909  *
7910  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7911  * try:
7912  * _import_umath()
7913  */
7914 
7915 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
7916  int __pyx_r;
7917  __Pyx_RefNannyDeclarations
7918  PyObject *__pyx_t_1 = NULL;
7919  PyObject *__pyx_t_2 = NULL;
7920  PyObject *__pyx_t_3 = NULL;
7921  int __pyx_t_4;
7922  PyObject *__pyx_t_5 = NULL;
7923  PyObject *__pyx_t_6 = NULL;
7924  PyObject *__pyx_t_7 = NULL;
7925  PyObject *__pyx_t_8 = NULL;
7926  int __pyx_lineno = 0;
7927  const char *__pyx_filename = NULL;
7928  int __pyx_clineno = 0;
7929  __Pyx_RefNannySetupContext("import_umath", 0);
7930 
7931  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":962
7932  *
7933  * cdef inline int import_umath() except -1:
7934  * try: # <<<<<<<<<<<<<<
7935  * _import_umath()
7936  * except Exception:
7937  */
7938  {
7939  __Pyx_PyThreadState_declare
7940  __Pyx_PyThreadState_assign
7941  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7942  __Pyx_XGOTREF(__pyx_t_1);
7943  __Pyx_XGOTREF(__pyx_t_2);
7944  __Pyx_XGOTREF(__pyx_t_3);
7945  /*try:*/ {
7946 
7947  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":963
7948  * cdef inline int import_umath() except -1:
7949  * try:
7950  * _import_umath() # <<<<<<<<<<<<<<
7951  * except Exception:
7952  * raise ImportError("numpy.core.umath failed to import")
7953  */
7954  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 963, __pyx_L3_error)
7955 
7956  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":962
7957  *
7958  * cdef inline int import_umath() except -1:
7959  * try: # <<<<<<<<<<<<<<
7960  * _import_umath()
7961  * except Exception:
7962  */
7963  }
7964  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7965  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7966  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7967  goto __pyx_L8_try_end;
7968  __pyx_L3_error:;
7969 
7970  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":964
7971  * try:
7972  * _import_umath()
7973  * except Exception: # <<<<<<<<<<<<<<
7974  * raise ImportError("numpy.core.umath failed to import")
7975  *
7976  */
7977  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7978  if (__pyx_t_4) {
7979  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7980  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 964, __pyx_L5_except_error)
7981  __Pyx_GOTREF(__pyx_t_5);
7982  __Pyx_GOTREF(__pyx_t_6);
7983  __Pyx_GOTREF(__pyx_t_7);
7984 
7985  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":965
7986  * _import_umath()
7987  * except Exception:
7988  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7989  *
7990  * cdef inline int import_ufunc() except -1:
7991  */
7992  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 965, __pyx_L5_except_error)
7993  __Pyx_GOTREF(__pyx_t_8);
7994  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7995  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7996  __PYX_ERR(1, 965, __pyx_L5_except_error)
7997  }
7998  goto __pyx_L5_except_error;
7999  __pyx_L5_except_error:;
8000 
8001  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":962
8002  *
8003  * cdef inline int import_umath() except -1:
8004  * try: # <<<<<<<<<<<<<<
8005  * _import_umath()
8006  * except Exception:
8007  */
8008  __Pyx_XGIVEREF(__pyx_t_1);
8009  __Pyx_XGIVEREF(__pyx_t_2);
8010  __Pyx_XGIVEREF(__pyx_t_3);
8011  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8012  goto __pyx_L1_error;
8013  __pyx_L8_try_end:;
8014  }
8015 
8016  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":961
8017  * raise ImportError("numpy.core.multiarray failed to import")
8018  *
8019  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8020  * try:
8021  * _import_umath()
8022  */
8023 
8024  /* function exit code */
8025  __pyx_r = 0;
8026  goto __pyx_L0;
8027  __pyx_L1_error:;
8028  __Pyx_XDECREF(__pyx_t_5);
8029  __Pyx_XDECREF(__pyx_t_6);
8030  __Pyx_XDECREF(__pyx_t_7);
8031  __Pyx_XDECREF(__pyx_t_8);
8032  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8033  __pyx_r = -1;
8034  __pyx_L0:;
8035  __Pyx_RefNannyFinishContext();
8036  return __pyx_r;
8037 }
8038 
8039 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":967
8040  * raise ImportError("numpy.core.umath failed to import")
8041  *
8042  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8043  * try:
8044  * _import_umath()
8045  */
8046 
8047 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
8048  int __pyx_r;
8049  __Pyx_RefNannyDeclarations
8050  PyObject *__pyx_t_1 = NULL;
8051  PyObject *__pyx_t_2 = NULL;
8052  PyObject *__pyx_t_3 = NULL;
8053  int __pyx_t_4;
8054  PyObject *__pyx_t_5 = NULL;
8055  PyObject *__pyx_t_6 = NULL;
8056  PyObject *__pyx_t_7 = NULL;
8057  PyObject *__pyx_t_8 = NULL;
8058  int __pyx_lineno = 0;
8059  const char *__pyx_filename = NULL;
8060  int __pyx_clineno = 0;
8061  __Pyx_RefNannySetupContext("import_ufunc", 0);
8062 
8063  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":968
8064  *
8065  * cdef inline int import_ufunc() except -1:
8066  * try: # <<<<<<<<<<<<<<
8067  * _import_umath()
8068  * except Exception:
8069  */
8070  {
8071  __Pyx_PyThreadState_declare
8072  __Pyx_PyThreadState_assign
8073  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8074  __Pyx_XGOTREF(__pyx_t_1);
8075  __Pyx_XGOTREF(__pyx_t_2);
8076  __Pyx_XGOTREF(__pyx_t_3);
8077  /*try:*/ {
8078 
8079  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":969
8080  * cdef inline int import_ufunc() except -1:
8081  * try:
8082  * _import_umath() # <<<<<<<<<<<<<<
8083  * except Exception:
8084  * raise ImportError("numpy.core.umath failed to import")
8085  */
8086  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 969, __pyx_L3_error)
8087 
8088  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":968
8089  *
8090  * cdef inline int import_ufunc() except -1:
8091  * try: # <<<<<<<<<<<<<<
8092  * _import_umath()
8093  * except Exception:
8094  */
8095  }
8096  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8097  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8098  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8099  goto __pyx_L8_try_end;
8100  __pyx_L3_error:;
8101 
8102  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":970
8103  * try:
8104  * _import_umath()
8105  * except Exception: # <<<<<<<<<<<<<<
8106  * raise ImportError("numpy.core.umath failed to import")
8107  *
8108  */
8109  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8110  if (__pyx_t_4) {
8111  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8112  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 970, __pyx_L5_except_error)
8113  __Pyx_GOTREF(__pyx_t_5);
8114  __Pyx_GOTREF(__pyx_t_6);
8115  __Pyx_GOTREF(__pyx_t_7);
8116 
8117  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":971
8118  * _import_umath()
8119  * except Exception:
8120  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8121  *
8122  * cdef extern from *:
8123  */
8124  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 971, __pyx_L5_except_error)
8125  __Pyx_GOTREF(__pyx_t_8);
8126  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8127  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8128  __PYX_ERR(1, 971, __pyx_L5_except_error)
8129  }
8130  goto __pyx_L5_except_error;
8131  __pyx_L5_except_error:;
8132 
8133  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":968
8134  *
8135  * cdef inline int import_ufunc() except -1:
8136  * try: # <<<<<<<<<<<<<<
8137  * _import_umath()
8138  * except Exception:
8139  */
8140  __Pyx_XGIVEREF(__pyx_t_1);
8141  __Pyx_XGIVEREF(__pyx_t_2);
8142  __Pyx_XGIVEREF(__pyx_t_3);
8143  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8144  goto __pyx_L1_error;
8145  __pyx_L8_try_end:;
8146  }
8147 
8148  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":967
8149  * raise ImportError("numpy.core.umath failed to import")
8150  *
8151  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8152  * try:
8153  * _import_umath()
8154  */
8155 
8156  /* function exit code */
8157  __pyx_r = 0;
8158  goto __pyx_L0;
8159  __pyx_L1_error:;
8160  __Pyx_XDECREF(__pyx_t_5);
8161  __Pyx_XDECREF(__pyx_t_6);
8162  __Pyx_XDECREF(__pyx_t_7);
8163  __Pyx_XDECREF(__pyx_t_8);
8164  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8165  __pyx_r = -1;
8166  __pyx_L0:;
8167  __Pyx_RefNannyFinishContext();
8168  return __pyx_r;
8169 }
8170 
8171 /* "View.MemoryView":122
8172  * cdef bint dtype_is_object
8173  *
8174  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8175  * mode="c", bint allocate_buffer=True):
8176  *
8177  */
8178 
8179 /* Python wrapper */
8180 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8181 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8182  PyObject *__pyx_v_shape = 0;
8183  Py_ssize_t __pyx_v_itemsize;
8184  PyObject *__pyx_v_format = 0;
8185  PyObject *__pyx_v_mode = 0;
8186  int __pyx_v_allocate_buffer;
8187  int __pyx_lineno = 0;
8188  const char *__pyx_filename = NULL;
8189  int __pyx_clineno = 0;
8190  int __pyx_r;
8191  __Pyx_RefNannyDeclarations
8192  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8193  {
8194  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
8195  PyObject* values[5] = {0,0,0,0,0};
8196  values[3] = ((PyObject *)__pyx_n_s_c);
8197  if (unlikely(__pyx_kwds)) {
8198  Py_ssize_t kw_args;
8199  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8200  switch (pos_args) {
8201  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8202  CYTHON_FALLTHROUGH;
8203  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8204  CYTHON_FALLTHROUGH;
8205  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8206  CYTHON_FALLTHROUGH;
8207  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8208  CYTHON_FALLTHROUGH;
8209  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8210  CYTHON_FALLTHROUGH;
8211  case 0: break;
8212  default: goto __pyx_L5_argtuple_error;
8213  }
8214  kw_args = PyDict_Size(__pyx_kwds);
8215  switch (pos_args) {
8216  case 0:
8217  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8218  else goto __pyx_L5_argtuple_error;
8219  CYTHON_FALLTHROUGH;
8220  case 1:
8221  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8222  else {
8223  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 122, __pyx_L3_error)
8224  }
8225  CYTHON_FALLTHROUGH;
8226  case 2:
8227  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8228  else {
8229  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 122, __pyx_L3_error)
8230  }
8231  CYTHON_FALLTHROUGH;
8232  case 3:
8233  if (kw_args > 0) {
8234  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8235  if (value) { values[3] = value; kw_args--; }
8236  }
8237  CYTHON_FALLTHROUGH;
8238  case 4:
8239  if (kw_args > 0) {
8240  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8241  if (value) { values[4] = value; kw_args--; }
8242  }
8243  }
8244  if (unlikely(kw_args > 0)) {
8245  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 122, __pyx_L3_error)
8246  }
8247  } else {
8248  switch (PyTuple_GET_SIZE(__pyx_args)) {
8249  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8250  CYTHON_FALLTHROUGH;
8251  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8252  CYTHON_FALLTHROUGH;
8253  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8254  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8255  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8256  break;
8257  default: goto __pyx_L5_argtuple_error;
8258  }
8259  }
8260  __pyx_v_shape = ((PyObject*)values[0]);
8261  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L3_error)
8262  __pyx_v_format = values[2];
8263  __pyx_v_mode = values[3];
8264  if (values[4]) {
8265  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error)
8266  } else {
8267 
8268  /* "View.MemoryView":123
8269  *
8270  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
8271  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
8272  *
8273  * cdef int idx
8274  */
8275  __pyx_v_allocate_buffer = ((int)1);
8276  }
8277  }
8278  goto __pyx_L4_argument_unpacking_done;
8279  __pyx_L5_argtuple_error:;
8280  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 122, __pyx_L3_error)
8281  __pyx_L3_error:;
8282  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8283  __Pyx_RefNannyFinishContext();
8284  return -1;
8285  __pyx_L4_argument_unpacking_done:;
8286  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 122, __pyx_L1_error)
8287  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8288  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 122, __pyx_L1_error)
8289  }
8290  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
8291 
8292  /* "View.MemoryView":122
8293  * cdef bint dtype_is_object
8294  *
8295  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8296  * mode="c", bint allocate_buffer=True):
8297  *
8298  */
8299 
8300  /* function exit code */
8301  goto __pyx_L0;
8302  __pyx_L1_error:;
8303  __pyx_r = -1;
8304  __pyx_L0:;
8305  __Pyx_RefNannyFinishContext();
8306  return __pyx_r;
8307 }
8308 
8309 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
8310  int __pyx_v_idx;
8311  Py_ssize_t __pyx_v_i;
8312  Py_ssize_t __pyx_v_dim;
8313  PyObject **__pyx_v_p;
8314  char __pyx_v_order;
8315  int __pyx_r;
8316  __Pyx_RefNannyDeclarations
8317  Py_ssize_t __pyx_t_1;
8318  int __pyx_t_2;
8319  PyObject *__pyx_t_3 = NULL;
8320  int __pyx_t_4;
8321  PyObject *__pyx_t_5 = NULL;
8322  PyObject *__pyx_t_6 = NULL;
8323  char *__pyx_t_7;
8324  int __pyx_t_8;
8325  Py_ssize_t __pyx_t_9;
8326  PyObject *__pyx_t_10 = NULL;
8327  Py_ssize_t __pyx_t_11;
8328  int __pyx_lineno = 0;
8329  const char *__pyx_filename = NULL;
8330  int __pyx_clineno = 0;
8331  __Pyx_RefNannySetupContext("__cinit__", 0);
8332  __Pyx_INCREF(__pyx_v_format);
8333 
8334  /* "View.MemoryView":129
8335  * cdef PyObject **p
8336  *
8337  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
8338  * self.itemsize = itemsize
8339  *
8340  */
8341  if (unlikely(__pyx_v_shape == Py_None)) {
8342  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8343  __PYX_ERR(2, 129, __pyx_L1_error)
8344  }
8345  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 129, __pyx_L1_error)
8346  __pyx_v_self->ndim = ((int)__pyx_t_1);
8347 
8348  /* "View.MemoryView":130
8349  *
8350  * self.ndim = <int> len(shape)
8351  * self.itemsize = itemsize # <<<<<<<<<<<<<<
8352  *
8353  * if not self.ndim:
8354  */
8355  __pyx_v_self->itemsize = __pyx_v_itemsize;
8356 
8357  /* "View.MemoryView":132
8358  * self.itemsize = itemsize
8359  *
8360  * if not self.ndim: # <<<<<<<<<<<<<<
8361  * raise ValueError("Empty shape tuple for cython.array")
8362  *
8363  */
8364  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8365  if (unlikely(__pyx_t_2)) {
8366 
8367  /* "View.MemoryView":133
8368  *
8369  * if not self.ndim:
8370  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
8371  *
8372  * if itemsize <= 0:
8373  */
8374  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 133, __pyx_L1_error)
8375  __Pyx_GOTREF(__pyx_t_3);
8376  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8377  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8378  __PYX_ERR(2, 133, __pyx_L1_error)
8379 
8380  /* "View.MemoryView":132
8381  * self.itemsize = itemsize
8382  *
8383  * if not self.ndim: # <<<<<<<<<<<<<<
8384  * raise ValueError("Empty shape tuple for cython.array")
8385  *
8386  */
8387  }
8388 
8389  /* "View.MemoryView":135
8390  * raise ValueError("Empty shape tuple for cython.array")
8391  *
8392  * if itemsize <= 0: # <<<<<<<<<<<<<<
8393  * raise ValueError("itemsize <= 0 for cython.array")
8394  *
8395  */
8396  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8397  if (unlikely(__pyx_t_2)) {
8398 
8399  /* "View.MemoryView":136
8400  *
8401  * if itemsize <= 0:
8402  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
8403  *
8404  * if not isinstance(format, bytes):
8405  */
8406  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __pyx_L1_error)
8407  __Pyx_GOTREF(__pyx_t_3);
8408  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8409  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8410  __PYX_ERR(2, 136, __pyx_L1_error)
8411 
8412  /* "View.MemoryView":135
8413  * raise ValueError("Empty shape tuple for cython.array")
8414  *
8415  * if itemsize <= 0: # <<<<<<<<<<<<<<
8416  * raise ValueError("itemsize <= 0 for cython.array")
8417  *
8418  */
8419  }
8420 
8421  /* "View.MemoryView":138
8422  * raise ValueError("itemsize <= 0 for cython.array")
8423  *
8424  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8425  * format = format.encode('ASCII')
8426  * self._format = format # keep a reference to the byte string
8427  */
8428  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8429  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8430  if (__pyx_t_4) {
8431 
8432  /* "View.MemoryView":139
8433  *
8434  * if not isinstance(format, bytes):
8435  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
8436  * self._format = format # keep a reference to the byte string
8437  * self.format = self._format
8438  */
8439  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 139, __pyx_L1_error)
8440  __Pyx_GOTREF(__pyx_t_5);
8441  __pyx_t_6 = NULL;
8442  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8443  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8444  if (likely(__pyx_t_6)) {
8445  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8446  __Pyx_INCREF(__pyx_t_6);
8447  __Pyx_INCREF(function);
8448  __Pyx_DECREF_SET(__pyx_t_5, function);
8449  }
8450  }
8451  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
8452  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8453  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 139, __pyx_L1_error)
8454  __Pyx_GOTREF(__pyx_t_3);
8455  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8456  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
8457  __pyx_t_3 = 0;
8458 
8459  /* "View.MemoryView":138
8460  * raise ValueError("itemsize <= 0 for cython.array")
8461  *
8462  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8463  * format = format.encode('ASCII')
8464  * self._format = format # keep a reference to the byte string
8465  */
8466  }
8467 
8468  /* "View.MemoryView":140
8469  * if not isinstance(format, bytes):
8470  * format = format.encode('ASCII')
8471  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
8472  * self.format = self._format
8473  *
8474  */
8475  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 140, __pyx_L1_error)
8476  __pyx_t_3 = __pyx_v_format;
8477  __Pyx_INCREF(__pyx_t_3);
8478  __Pyx_GIVEREF(__pyx_t_3);
8479  __Pyx_GOTREF(__pyx_v_self->_format);
8480  __Pyx_DECREF(__pyx_v_self->_format);
8481  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
8482  __pyx_t_3 = 0;
8483 
8484  /* "View.MemoryView":141
8485  * format = format.encode('ASCII')
8486  * self._format = format # keep a reference to the byte string
8487  * self.format = self._format # <<<<<<<<<<<<<<
8488  *
8489  *
8490  */
8491  if (unlikely(__pyx_v_self->_format == Py_None)) {
8492  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
8493  __PYX_ERR(2, 141, __pyx_L1_error)
8494  }
8495  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 141, __pyx_L1_error)
8496  __pyx_v_self->format = __pyx_t_7;
8497 
8498  /* "View.MemoryView":144
8499  *
8500  *
8501  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
8502  * self._strides = self._shape + self.ndim
8503  *
8504  */
8505  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8506 
8507  /* "View.MemoryView":145
8508  *
8509  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
8510  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
8511  *
8512  * if not self._shape:
8513  */
8514  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8515 
8516  /* "View.MemoryView":147
8517  * self._strides = self._shape + self.ndim
8518  *
8519  * if not self._shape: # <<<<<<<<<<<<<<
8520  * raise MemoryError("unable to allocate shape and strides.")
8521  *
8522  */
8523  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8524  if (unlikely(__pyx_t_4)) {
8525 
8526  /* "View.MemoryView":148
8527  *
8528  * if not self._shape:
8529  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
8530  *
8531  *
8532  */
8533  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error)
8534  __Pyx_GOTREF(__pyx_t_3);
8535  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8536  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8537  __PYX_ERR(2, 148, __pyx_L1_error)
8538 
8539  /* "View.MemoryView":147
8540  * self._strides = self._shape + self.ndim
8541  *
8542  * if not self._shape: # <<<<<<<<<<<<<<
8543  * raise MemoryError("unable to allocate shape and strides.")
8544  *
8545  */
8546  }
8547 
8548  /* "View.MemoryView":151
8549  *
8550  *
8551  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8552  * if dim <= 0:
8553  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8554  */
8555  __pyx_t_8 = 0;
8556  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8557  for (;;) {
8558  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
8559  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8560  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 151, __pyx_L1_error)
8561  #else
8562  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 151, __pyx_L1_error)
8563  __Pyx_GOTREF(__pyx_t_5);
8564  #endif
8565  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 151, __pyx_L1_error)
8566  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8567  __pyx_v_dim = __pyx_t_9;
8568  __pyx_v_idx = __pyx_t_8;
8569  __pyx_t_8 = (__pyx_t_8 + 1);
8570 
8571  /* "View.MemoryView":152
8572  *
8573  * for idx, dim in enumerate(shape):
8574  * if dim <= 0: # <<<<<<<<<<<<<<
8575  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8576  * self._shape[idx] = dim
8577  */
8578  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8579  if (unlikely(__pyx_t_4)) {
8580 
8581  /* "View.MemoryView":153
8582  * for idx, dim in enumerate(shape):
8583  * if dim <= 0:
8584  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
8585  * self._shape[idx] = dim
8586  *
8587  */
8588  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 153, __pyx_L1_error)
8589  __Pyx_GOTREF(__pyx_t_5);
8590  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
8591  __Pyx_GOTREF(__pyx_t_6);
8592  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
8593  __Pyx_GOTREF(__pyx_t_10);
8594  __Pyx_GIVEREF(__pyx_t_5);
8595  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
8596  __Pyx_GIVEREF(__pyx_t_6);
8597  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
8598  __pyx_t_5 = 0;
8599  __pyx_t_6 = 0;
8600  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
8601  __Pyx_GOTREF(__pyx_t_6);
8602  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8603  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
8604  __Pyx_GOTREF(__pyx_t_10);
8605  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8606  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8607  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8608  __PYX_ERR(2, 153, __pyx_L1_error)
8609 
8610  /* "View.MemoryView":152
8611  *
8612  * for idx, dim in enumerate(shape):
8613  * if dim <= 0: # <<<<<<<<<<<<<<
8614  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8615  * self._shape[idx] = dim
8616  */
8617  }
8618 
8619  /* "View.MemoryView":154
8620  * if dim <= 0:
8621  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8622  * self._shape[idx] = dim # <<<<<<<<<<<<<<
8623  *
8624  * cdef char order
8625  */
8626  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8627 
8628  /* "View.MemoryView":151
8629  *
8630  *
8631  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8632  * if dim <= 0:
8633  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8634  */
8635  }
8636  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8637 
8638  /* "View.MemoryView":157
8639  *
8640  * cdef char order
8641  * if mode == 'fortran': # <<<<<<<<<<<<<<
8642  * order = b'F'
8643  * self.mode = u'fortran'
8644  */
8645  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 157, __pyx_L1_error)
8646  if (__pyx_t_4) {
8647 
8648  /* "View.MemoryView":158
8649  * cdef char order
8650  * if mode == 'fortran':
8651  * order = b'F' # <<<<<<<<<<<<<<
8652  * self.mode = u'fortran'
8653  * elif mode == 'c':
8654  */
8655  __pyx_v_order = 'F';
8656 
8657  /* "View.MemoryView":159
8658  * if mode == 'fortran':
8659  * order = b'F'
8660  * self.mode = u'fortran' # <<<<<<<<<<<<<<
8661  * elif mode == 'c':
8662  * order = b'C'
8663  */
8664  __Pyx_INCREF(__pyx_n_u_fortran);
8665  __Pyx_GIVEREF(__pyx_n_u_fortran);
8666  __Pyx_GOTREF(__pyx_v_self->mode);
8667  __Pyx_DECREF(__pyx_v_self->mode);
8668  __pyx_v_self->mode = __pyx_n_u_fortran;
8669 
8670  /* "View.MemoryView":157
8671  *
8672  * cdef char order
8673  * if mode == 'fortran': # <<<<<<<<<<<<<<
8674  * order = b'F'
8675  * self.mode = u'fortran'
8676  */
8677  goto __pyx_L10;
8678  }
8679 
8680  /* "View.MemoryView":160
8681  * order = b'F'
8682  * self.mode = u'fortran'
8683  * elif mode == 'c': # <<<<<<<<<<<<<<
8684  * order = b'C'
8685  * self.mode = u'c'
8686  */
8687  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 160, __pyx_L1_error)
8688  if (likely(__pyx_t_4)) {
8689 
8690  /* "View.MemoryView":161
8691  * self.mode = u'fortran'
8692  * elif mode == 'c':
8693  * order = b'C' # <<<<<<<<<<<<<<
8694  * self.mode = u'c'
8695  * else:
8696  */
8697  __pyx_v_order = 'C';
8698 
8699  /* "View.MemoryView":162
8700  * elif mode == 'c':
8701  * order = b'C'
8702  * self.mode = u'c' # <<<<<<<<<<<<<<
8703  * else:
8704  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8705  */
8706  __Pyx_INCREF(__pyx_n_u_c);
8707  __Pyx_GIVEREF(__pyx_n_u_c);
8708  __Pyx_GOTREF(__pyx_v_self->mode);
8709  __Pyx_DECREF(__pyx_v_self->mode);
8710  __pyx_v_self->mode = __pyx_n_u_c;
8711 
8712  /* "View.MemoryView":160
8713  * order = b'F'
8714  * self.mode = u'fortran'
8715  * elif mode == 'c': # <<<<<<<<<<<<<<
8716  * order = b'C'
8717  * self.mode = u'c'
8718  */
8719  goto __pyx_L10;
8720  }
8721 
8722  /* "View.MemoryView":164
8723  * self.mode = u'c'
8724  * else:
8725  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
8726  *
8727  * self.len = fill_contig_strides_array(self._shape, self._strides,
8728  */
8729  /*else*/ {
8730  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 164, __pyx_L1_error)
8731  __Pyx_GOTREF(__pyx_t_3);
8732  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 164, __pyx_L1_error)
8733  __Pyx_GOTREF(__pyx_t_10);
8734  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8735  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8736  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8737  __PYX_ERR(2, 164, __pyx_L1_error)
8738  }
8739  __pyx_L10:;
8740 
8741  /* "View.MemoryView":166
8742  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8743  *
8744  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
8745  * itemsize, self.ndim, order)
8746  *
8747  */
8748  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
8749 
8750  /* "View.MemoryView":169
8751  * itemsize, self.ndim, order)
8752  *
8753  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
8754  * self.dtype_is_object = format == b'O'
8755  * if allocate_buffer:
8756  */
8757  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8758 
8759  /* "View.MemoryView":170
8760  *
8761  * self.free_data = allocate_buffer
8762  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
8763  * if allocate_buffer:
8764  *
8765  */
8766  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 170, __pyx_L1_error)
8767  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 170, __pyx_L1_error)
8768  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8769  __pyx_v_self->dtype_is_object = __pyx_t_4;
8770 
8771  /* "View.MemoryView":171
8772  * self.free_data = allocate_buffer
8773  * self.dtype_is_object = format == b'O'
8774  * if allocate_buffer: # <<<<<<<<<<<<<<
8775  *
8776  *
8777  */
8778  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8779  if (__pyx_t_4) {
8780 
8781  /* "View.MemoryView":174
8782  *
8783  *
8784  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
8785  * if not self.data:
8786  * raise MemoryError("unable to allocate array data.")
8787  */
8788  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
8789 
8790  /* "View.MemoryView":175
8791  *
8792  * self.data = <char *>malloc(self.len)
8793  * if not self.data: # <<<<<<<<<<<<<<
8794  * raise MemoryError("unable to allocate array data.")
8795  *
8796  */
8797  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8798  if (unlikely(__pyx_t_4)) {
8799 
8800  /* "View.MemoryView":176
8801  * self.data = <char *>malloc(self.len)
8802  * if not self.data:
8803  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
8804  *
8805  * if self.dtype_is_object:
8806  */
8807  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 176, __pyx_L1_error)
8808  __Pyx_GOTREF(__pyx_t_10);
8809  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8810  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8811  __PYX_ERR(2, 176, __pyx_L1_error)
8812 
8813  /* "View.MemoryView":175
8814  *
8815  * self.data = <char *>malloc(self.len)
8816  * if not self.data: # <<<<<<<<<<<<<<
8817  * raise MemoryError("unable to allocate array data.")
8818  *
8819  */
8820  }
8821 
8822  /* "View.MemoryView":178
8823  * raise MemoryError("unable to allocate array data.")
8824  *
8825  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8826  * p = <PyObject **> self.data
8827  * for i in range(self.len / itemsize):
8828  */
8829  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8830  if (__pyx_t_4) {
8831 
8832  /* "View.MemoryView":179
8833  *
8834  * if self.dtype_is_object:
8835  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
8836  * for i in range(self.len / itemsize):
8837  * p[i] = Py_None
8838  */
8839  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8840 
8841  /* "View.MemoryView":180
8842  * if self.dtype_is_object:
8843  * p = <PyObject **> self.data
8844  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
8845  * p[i] = Py_None
8846  * Py_INCREF(Py_None)
8847  */
8848  if (unlikely(__pyx_v_itemsize == 0)) {
8849  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
8850  __PYX_ERR(2, 180, __pyx_L1_error)
8851  }
8852  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
8853  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
8854  __PYX_ERR(2, 180, __pyx_L1_error)
8855  }
8856  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8857  __pyx_t_9 = __pyx_t_1;
8858  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
8859  __pyx_v_i = __pyx_t_11;
8860 
8861  /* "View.MemoryView":181
8862  * p = <PyObject **> self.data
8863  * for i in range(self.len / itemsize):
8864  * p[i] = Py_None # <<<<<<<<<<<<<<
8865  * Py_INCREF(Py_None)
8866  *
8867  */
8868  (__pyx_v_p[__pyx_v_i]) = Py_None;
8869 
8870  /* "View.MemoryView":182
8871  * for i in range(self.len / itemsize):
8872  * p[i] = Py_None
8873  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
8874  *
8875  * @cname('getbuffer')
8876  */
8877  Py_INCREF(Py_None);
8878  }
8879 
8880  /* "View.MemoryView":178
8881  * raise MemoryError("unable to allocate array data.")
8882  *
8883  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8884  * p = <PyObject **> self.data
8885  * for i in range(self.len / itemsize):
8886  */
8887  }
8888 
8889  /* "View.MemoryView":171
8890  * self.free_data = allocate_buffer
8891  * self.dtype_is_object = format == b'O'
8892  * if allocate_buffer: # <<<<<<<<<<<<<<
8893  *
8894  *
8895  */
8896  }
8897 
8898  /* "View.MemoryView":122
8899  * cdef bint dtype_is_object
8900  *
8901  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8902  * mode="c", bint allocate_buffer=True):
8903  *
8904  */
8905 
8906  /* function exit code */
8907  __pyx_r = 0;
8908  goto __pyx_L0;
8909  __pyx_L1_error:;
8910  __Pyx_XDECREF(__pyx_t_3);
8911  __Pyx_XDECREF(__pyx_t_5);
8912  __Pyx_XDECREF(__pyx_t_6);
8913  __Pyx_XDECREF(__pyx_t_10);
8914  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8915  __pyx_r = -1;
8916  __pyx_L0:;
8917  __Pyx_XDECREF(__pyx_v_format);
8918  __Pyx_RefNannyFinishContext();
8919  return __pyx_r;
8920 }
8921 
8922 /* "View.MemoryView":185
8923  *
8924  * @cname('getbuffer')
8925  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8926  * cdef int bufmode = -1
8927  * if self.mode == u"c":
8928  */
8929 
8930 /* Python wrapper */
8931 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
8932 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8933  int __pyx_r;
8934  __Pyx_RefNannyDeclarations
8935  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
8936  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
8937 
8938  /* function exit code */
8939  __Pyx_RefNannyFinishContext();
8940  return __pyx_r;
8941 }
8942 
8943 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8944  int __pyx_v_bufmode;
8945  int __pyx_r;
8946  __Pyx_RefNannyDeclarations
8947  int __pyx_t_1;
8948  int __pyx_t_2;
8949  PyObject *__pyx_t_3 = NULL;
8950  char *__pyx_t_4;
8951  Py_ssize_t __pyx_t_5;
8952  int __pyx_t_6;
8953  Py_ssize_t *__pyx_t_7;
8954  int __pyx_lineno = 0;
8955  const char *__pyx_filename = NULL;
8956  int __pyx_clineno = 0;
8957  if (__pyx_v_info == NULL) {
8958  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
8959  return -1;
8960  }
8961  __Pyx_RefNannySetupContext("__getbuffer__", 0);
8962  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8963  __Pyx_GIVEREF(__pyx_v_info->obj);
8964 
8965  /* "View.MemoryView":186
8966  * @cname('getbuffer')
8967  * def __getbuffer__(self, Py_buffer *info, int flags):
8968  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
8969  * if self.mode == u"c":
8970  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8971  */
8972  __pyx_v_bufmode = -1;
8973 
8974  /* "View.MemoryView":187
8975  * def __getbuffer__(self, Py_buffer *info, int flags):
8976  * cdef int bufmode = -1
8977  * if self.mode == u"c": # <<<<<<<<<<<<<<
8978  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8979  * elif self.mode == u"fortran":
8980  */
8981  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 187, __pyx_L1_error)
8982  __pyx_t_2 = (__pyx_t_1 != 0);
8983  if (__pyx_t_2) {
8984 
8985  /* "View.MemoryView":188
8986  * cdef int bufmode = -1
8987  * if self.mode == u"c":
8988  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
8989  * elif self.mode == u"fortran":
8990  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8991  */
8992  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8993 
8994  /* "View.MemoryView":187
8995  * def __getbuffer__(self, Py_buffer *info, int flags):
8996  * cdef int bufmode = -1
8997  * if self.mode == u"c": # <<<<<<<<<<<<<<
8998  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8999  * elif self.mode == u"fortran":
9000  */
9001  goto __pyx_L3;
9002  }
9003 
9004  /* "View.MemoryView":189
9005  * if self.mode == u"c":
9006  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9007  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9008  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9009  * if not (flags & bufmode):
9010  */
9011  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 189, __pyx_L1_error)
9012  __pyx_t_1 = (__pyx_t_2 != 0);
9013  if (__pyx_t_1) {
9014 
9015  /* "View.MemoryView":190
9016  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9017  * elif self.mode == u"fortran":
9018  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9019  * if not (flags & bufmode):
9020  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9021  */
9022  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9023 
9024  /* "View.MemoryView":189
9025  * if self.mode == u"c":
9026  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9027  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9028  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9029  * if not (flags & bufmode):
9030  */
9031  }
9032  __pyx_L3:;
9033 
9034  /* "View.MemoryView":191
9035  * elif self.mode == u"fortran":
9036  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9037  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9038  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9039  * info.buf = self.data
9040  */
9041  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
9042  if (unlikely(__pyx_t_1)) {
9043 
9044  /* "View.MemoryView":192
9045  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9046  * if not (flags & bufmode):
9047  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
9048  * info.buf = self.data
9049  * info.len = self.len
9050  */
9051  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 192, __pyx_L1_error)
9052  __Pyx_GOTREF(__pyx_t_3);
9053  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9054  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9055  __PYX_ERR(2, 192, __pyx_L1_error)
9056 
9057  /* "View.MemoryView":191
9058  * elif self.mode == u"fortran":
9059  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9060  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9061  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9062  * info.buf = self.data
9063  */
9064  }
9065 
9066  /* "View.MemoryView":193
9067  * if not (flags & bufmode):
9068  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9069  * info.buf = self.data # <<<<<<<<<<<<<<
9070  * info.len = self.len
9071  * info.ndim = self.ndim
9072  */
9073  __pyx_t_4 = __pyx_v_self->data;
9074  __pyx_v_info->buf = __pyx_t_4;
9075 
9076  /* "View.MemoryView":194
9077  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9078  * info.buf = self.data
9079  * info.len = self.len # <<<<<<<<<<<<<<
9080  * info.ndim = self.ndim
9081  * info.shape = self._shape
9082  */
9083  __pyx_t_5 = __pyx_v_self->len;
9084  __pyx_v_info->len = __pyx_t_5;
9085 
9086  /* "View.MemoryView":195
9087  * info.buf = self.data
9088  * info.len = self.len
9089  * info.ndim = self.ndim # <<<<<<<<<<<<<<
9090  * info.shape = self._shape
9091  * info.strides = self._strides
9092  */
9093  __pyx_t_6 = __pyx_v_self->ndim;
9094  __pyx_v_info->ndim = __pyx_t_6;
9095 
9096  /* "View.MemoryView":196
9097  * info.len = self.len
9098  * info.ndim = self.ndim
9099  * info.shape = self._shape # <<<<<<<<<<<<<<
9100  * info.strides = self._strides
9101  * info.suboffsets = NULL
9102  */
9103  __pyx_t_7 = __pyx_v_self->_shape;
9104  __pyx_v_info->shape = __pyx_t_7;
9105 
9106  /* "View.MemoryView":197
9107  * info.ndim = self.ndim
9108  * info.shape = self._shape
9109  * info.strides = self._strides # <<<<<<<<<<<<<<
9110  * info.suboffsets = NULL
9111  * info.itemsize = self.itemsize
9112  */
9113  __pyx_t_7 = __pyx_v_self->_strides;
9114  __pyx_v_info->strides = __pyx_t_7;
9115 
9116  /* "View.MemoryView":198
9117  * info.shape = self._shape
9118  * info.strides = self._strides
9119  * info.suboffsets = NULL # <<<<<<<<<<<<<<
9120  * info.itemsize = self.itemsize
9121  * info.readonly = 0
9122  */
9123  __pyx_v_info->suboffsets = NULL;
9124 
9125  /* "View.MemoryView":199
9126  * info.strides = self._strides
9127  * info.suboffsets = NULL
9128  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
9129  * info.readonly = 0
9130  *
9131  */
9132  __pyx_t_5 = __pyx_v_self->itemsize;
9133  __pyx_v_info->itemsize = __pyx_t_5;
9134 
9135  /* "View.MemoryView":200
9136  * info.suboffsets = NULL
9137  * info.itemsize = self.itemsize
9138  * info.readonly = 0 # <<<<<<<<<<<<<<
9139  *
9140  * if flags & PyBUF_FORMAT:
9141  */
9142  __pyx_v_info->readonly = 0;
9143 
9144  /* "View.MemoryView":202
9145  * info.readonly = 0
9146  *
9147  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9148  * info.format = self.format
9149  * else:
9150  */
9151  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9152  if (__pyx_t_1) {
9153 
9154  /* "View.MemoryView":203
9155  *
9156  * if flags & PyBUF_FORMAT:
9157  * info.format = self.format # <<<<<<<<<<<<<<
9158  * else:
9159  * info.format = NULL
9160  */
9161  __pyx_t_4 = __pyx_v_self->format;
9162  __pyx_v_info->format = __pyx_t_4;
9163 
9164  /* "View.MemoryView":202
9165  * info.readonly = 0
9166  *
9167  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9168  * info.format = self.format
9169  * else:
9170  */
9171  goto __pyx_L5;
9172  }
9173 
9174  /* "View.MemoryView":205
9175  * info.format = self.format
9176  * else:
9177  * info.format = NULL # <<<<<<<<<<<<<<
9178  *
9179  * info.obj = self
9180  */
9181  /*else*/ {
9182  __pyx_v_info->format = NULL;
9183  }
9184  __pyx_L5:;
9185 
9186  /* "View.MemoryView":207
9187  * info.format = NULL
9188  *
9189  * info.obj = self # <<<<<<<<<<<<<<
9190  *
9191  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9192  */
9193  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9194  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9195  __Pyx_GOTREF(__pyx_v_info->obj);
9196  __Pyx_DECREF(__pyx_v_info->obj);
9197  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9198 
9199  /* "View.MemoryView":185
9200  *
9201  * @cname('getbuffer')
9202  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9203  * cdef int bufmode = -1
9204  * if self.mode == u"c":
9205  */
9206 
9207  /* function exit code */
9208  __pyx_r = 0;
9209  goto __pyx_L0;
9210  __pyx_L1_error:;
9211  __Pyx_XDECREF(__pyx_t_3);
9212  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9213  __pyx_r = -1;
9214  if (__pyx_v_info->obj != NULL) {
9215  __Pyx_GOTREF(__pyx_v_info->obj);
9216  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9217  }
9218  goto __pyx_L2;
9219  __pyx_L0:;
9220  if (__pyx_v_info->obj == Py_None) {
9221  __Pyx_GOTREF(__pyx_v_info->obj);
9222  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9223  }
9224  __pyx_L2:;
9225  __Pyx_RefNannyFinishContext();
9226  return __pyx_r;
9227 }
9228 
9229 /* "View.MemoryView":211
9230  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9231  *
9232  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9233  * if self.callback_free_data != NULL:
9234  * self.callback_free_data(self.data)
9235  */
9236 
9237 /* Python wrapper */
9238 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
9239 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9240  __Pyx_RefNannyDeclarations
9241  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9242  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
9243 
9244  /* function exit code */
9245  __Pyx_RefNannyFinishContext();
9246 }
9247 
9248 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
9249  __Pyx_RefNannyDeclarations
9250  int __pyx_t_1;
9251  __Pyx_RefNannySetupContext("__dealloc__", 0);
9252 
9253  /* "View.MemoryView":212
9254  *
9255  * def __dealloc__(array self):
9256  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9257  * self.callback_free_data(self.data)
9258  * elif self.free_data:
9259  */
9260  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9261  if (__pyx_t_1) {
9262 
9263  /* "View.MemoryView":213
9264  * def __dealloc__(array self):
9265  * if self.callback_free_data != NULL:
9266  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
9267  * elif self.free_data:
9268  * if self.dtype_is_object:
9269  */
9270  __pyx_v_self->callback_free_data(__pyx_v_self->data);
9271 
9272  /* "View.MemoryView":212
9273  *
9274  * def __dealloc__(array self):
9275  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9276  * self.callback_free_data(self.data)
9277  * elif self.free_data:
9278  */
9279  goto __pyx_L3;
9280  }
9281 
9282  /* "View.MemoryView":214
9283  * if self.callback_free_data != NULL:
9284  * self.callback_free_data(self.data)
9285  * elif self.free_data: # <<<<<<<<<<<<<<
9286  * if self.dtype_is_object:
9287  * refcount_objects_in_slice(self.data, self._shape,
9288  */
9289  __pyx_t_1 = (__pyx_v_self->free_data != 0);
9290  if (__pyx_t_1) {
9291 
9292  /* "View.MemoryView":215
9293  * self.callback_free_data(self.data)
9294  * elif self.free_data:
9295  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9296  * refcount_objects_in_slice(self.data, self._shape,
9297  * self._strides, self.ndim, False)
9298  */
9299  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9300  if (__pyx_t_1) {
9301 
9302  /* "View.MemoryView":216
9303  * elif self.free_data:
9304  * if self.dtype_is_object:
9305  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
9306  * self._strides, self.ndim, False)
9307  * free(self.data)
9308  */
9309  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9310 
9311  /* "View.MemoryView":215
9312  * self.callback_free_data(self.data)
9313  * elif self.free_data:
9314  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9315  * refcount_objects_in_slice(self.data, self._shape,
9316  * self._strides, self.ndim, False)
9317  */
9318  }
9319 
9320  /* "View.MemoryView":218
9321  * refcount_objects_in_slice(self.data, self._shape,
9322  * self._strides, self.ndim, False)
9323  * free(self.data) # <<<<<<<<<<<<<<
9324  * PyObject_Free(self._shape)
9325  *
9326  */
9327  free(__pyx_v_self->data);
9328 
9329  /* "View.MemoryView":214
9330  * if self.callback_free_data != NULL:
9331  * self.callback_free_data(self.data)
9332  * elif self.free_data: # <<<<<<<<<<<<<<
9333  * if self.dtype_is_object:
9334  * refcount_objects_in_slice(self.data, self._shape,
9335  */
9336  }
9337  __pyx_L3:;
9338 
9339  /* "View.MemoryView":219
9340  * self._strides, self.ndim, False)
9341  * free(self.data)
9342  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
9343  *
9344  * @property
9345  */
9346  PyObject_Free(__pyx_v_self->_shape);
9347 
9348  /* "View.MemoryView":211
9349  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9350  *
9351  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9352  * if self.callback_free_data != NULL:
9353  * self.callback_free_data(self.data)
9354  */
9355 
9356  /* function exit code */
9357  __Pyx_RefNannyFinishContext();
9358 }
9359 
9360 /* "View.MemoryView":222
9361  *
9362  * @property
9363  * def memview(self): # <<<<<<<<<<<<<<
9364  * return self.get_memview()
9365  *
9366  */
9367 
9368 /* Python wrapper */
9369 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
9370 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9371  PyObject *__pyx_r = 0;
9372  __Pyx_RefNannyDeclarations
9373  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9374  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
9375 
9376  /* function exit code */
9377  __Pyx_RefNannyFinishContext();
9378  return __pyx_r;
9379 }
9380 
9381 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
9382  PyObject *__pyx_r = NULL;
9383  __Pyx_RefNannyDeclarations
9384  PyObject *__pyx_t_1 = NULL;
9385  int __pyx_lineno = 0;
9386  const char *__pyx_filename = NULL;
9387  int __pyx_clineno = 0;
9388  __Pyx_RefNannySetupContext("__get__", 0);
9389 
9390  /* "View.MemoryView":223
9391  * @property
9392  * def memview(self):
9393  * return self.get_memview() # <<<<<<<<<<<<<<
9394  *
9395  * @cname('get_memview')
9396  */
9397  __Pyx_XDECREF(__pyx_r);
9398  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 223, __pyx_L1_error)
9399  __Pyx_GOTREF(__pyx_t_1);
9400  __pyx_r = __pyx_t_1;
9401  __pyx_t_1 = 0;
9402  goto __pyx_L0;
9403 
9404  /* "View.MemoryView":222
9405  *
9406  * @property
9407  * def memview(self): # <<<<<<<<<<<<<<
9408  * return self.get_memview()
9409  *
9410  */
9411 
9412  /* function exit code */
9413  __pyx_L1_error:;
9414  __Pyx_XDECREF(__pyx_t_1);
9415  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9416  __pyx_r = NULL;
9417  __pyx_L0:;
9418  __Pyx_XGIVEREF(__pyx_r);
9419  __Pyx_RefNannyFinishContext();
9420  return __pyx_r;
9421 }
9422 
9423 /* "View.MemoryView":226
9424  *
9425  * @cname('get_memview')
9426  * cdef get_memview(self): # <<<<<<<<<<<<<<
9427  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9428  * return memoryview(self, flags, self.dtype_is_object)
9429  */
9430 
9431 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
9432  int __pyx_v_flags;
9433  PyObject *__pyx_r = NULL;
9434  __Pyx_RefNannyDeclarations
9435  PyObject *__pyx_t_1 = NULL;
9436  PyObject *__pyx_t_2 = NULL;
9437  PyObject *__pyx_t_3 = NULL;
9438  int __pyx_lineno = 0;
9439  const char *__pyx_filename = NULL;
9440  int __pyx_clineno = 0;
9441  __Pyx_RefNannySetupContext("get_memview", 0);
9442 
9443  /* "View.MemoryView":227
9444  * @cname('get_memview')
9445  * cdef get_memview(self):
9446  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
9447  * return memoryview(self, flags, self.dtype_is_object)
9448  *
9449  */
9450  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9451 
9452  /* "View.MemoryView":228
9453  * cdef get_memview(self):
9454  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9455  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
9456  *
9457  * def __len__(self):
9458  */
9459  __Pyx_XDECREF(__pyx_r);
9460  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 228, __pyx_L1_error)
9461  __Pyx_GOTREF(__pyx_t_1);
9462  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
9463  __Pyx_GOTREF(__pyx_t_2);
9464  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 228, __pyx_L1_error)
9465  __Pyx_GOTREF(__pyx_t_3);
9466  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9467  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9468  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9469  __Pyx_GIVEREF(__pyx_t_1);
9470  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9471  __Pyx_GIVEREF(__pyx_t_2);
9472  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9473  __pyx_t_1 = 0;
9474  __pyx_t_2 = 0;
9475  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
9476  __Pyx_GOTREF(__pyx_t_2);
9477  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9478  __pyx_r = __pyx_t_2;
9479  __pyx_t_2 = 0;
9480  goto __pyx_L0;
9481 
9482  /* "View.MemoryView":226
9483  *
9484  * @cname('get_memview')
9485  * cdef get_memview(self): # <<<<<<<<<<<<<<
9486  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9487  * return memoryview(self, flags, self.dtype_is_object)
9488  */
9489 
9490  /* function exit code */
9491  __pyx_L1_error:;
9492  __Pyx_XDECREF(__pyx_t_1);
9493  __Pyx_XDECREF(__pyx_t_2);
9494  __Pyx_XDECREF(__pyx_t_3);
9495  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9496  __pyx_r = 0;
9497  __pyx_L0:;
9498  __Pyx_XGIVEREF(__pyx_r);
9499  __Pyx_RefNannyFinishContext();
9500  return __pyx_r;
9501 }
9502 
9503 /* "View.MemoryView":230
9504  * return memoryview(self, flags, self.dtype_is_object)
9505  *
9506  * def __len__(self): # <<<<<<<<<<<<<<
9507  * return self._shape[0]
9508  *
9509  */
9510 
9511 /* Python wrapper */
9512 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
9513 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9514  Py_ssize_t __pyx_r;
9515  __Pyx_RefNannyDeclarations
9516  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
9517  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
9518 
9519  /* function exit code */
9520  __Pyx_RefNannyFinishContext();
9521  return __pyx_r;
9522 }
9523 
9524 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
9525  Py_ssize_t __pyx_r;
9526  __Pyx_RefNannyDeclarations
9527  __Pyx_RefNannySetupContext("__len__", 0);
9528 
9529  /* "View.MemoryView":231
9530  *
9531  * def __len__(self):
9532  * return self._shape[0] # <<<<<<<<<<<<<<
9533  *
9534  * def __getattr__(self, attr):
9535  */
9536  __pyx_r = (__pyx_v_self->_shape[0]);
9537  goto __pyx_L0;
9538 
9539  /* "View.MemoryView":230
9540  * return memoryview(self, flags, self.dtype_is_object)
9541  *
9542  * def __len__(self): # <<<<<<<<<<<<<<
9543  * return self._shape[0]
9544  *
9545  */
9546 
9547  /* function exit code */
9548  __pyx_L0:;
9549  __Pyx_RefNannyFinishContext();
9550  return __pyx_r;
9551 }
9552 
9553 /* "View.MemoryView":233
9554  * return self._shape[0]
9555  *
9556  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9557  * return getattr(self.memview, attr)
9558  *
9559  */
9560 
9561 /* Python wrapper */
9562 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
9563 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9564  PyObject *__pyx_r = 0;
9565  __Pyx_RefNannyDeclarations
9566  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
9567  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9568 
9569  /* function exit code */
9570  __Pyx_RefNannyFinishContext();
9571  return __pyx_r;
9572 }
9573 
9574 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9575  PyObject *__pyx_r = NULL;
9576  __Pyx_RefNannyDeclarations
9577  PyObject *__pyx_t_1 = NULL;
9578  PyObject *__pyx_t_2 = NULL;
9579  int __pyx_lineno = 0;
9580  const char *__pyx_filename = NULL;
9581  int __pyx_clineno = 0;
9582  __Pyx_RefNannySetupContext("__getattr__", 0);
9583 
9584  /* "View.MemoryView":234
9585  *
9586  * def __getattr__(self, attr):
9587  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
9588  *
9589  * def __getitem__(self, item):
9590  */
9591  __Pyx_XDECREF(__pyx_r);
9592  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 234, __pyx_L1_error)
9593  __Pyx_GOTREF(__pyx_t_1);
9594  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __pyx_L1_error)
9595  __Pyx_GOTREF(__pyx_t_2);
9596  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9597  __pyx_r = __pyx_t_2;
9598  __pyx_t_2 = 0;
9599  goto __pyx_L0;
9600 
9601  /* "View.MemoryView":233
9602  * return self._shape[0]
9603  *
9604  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9605  * return getattr(self.memview, attr)
9606  *
9607  */
9608 
9609  /* function exit code */
9610  __pyx_L1_error:;
9611  __Pyx_XDECREF(__pyx_t_1);
9612  __Pyx_XDECREF(__pyx_t_2);
9613  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9614  __pyx_r = NULL;
9615  __pyx_L0:;
9616  __Pyx_XGIVEREF(__pyx_r);
9617  __Pyx_RefNannyFinishContext();
9618  return __pyx_r;
9619 }
9620 
9621 /* "View.MemoryView":236
9622  * return getattr(self.memview, attr)
9623  *
9624  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9625  * return self.memview[item]
9626  *
9627  */
9628 
9629 /* Python wrapper */
9630 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
9631 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9632  PyObject *__pyx_r = 0;
9633  __Pyx_RefNannyDeclarations
9634  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9635  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9636 
9637  /* function exit code */
9638  __Pyx_RefNannyFinishContext();
9639  return __pyx_r;
9640 }
9641 
9642 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9643  PyObject *__pyx_r = NULL;
9644  __Pyx_RefNannyDeclarations
9645  PyObject *__pyx_t_1 = NULL;
9646  PyObject *__pyx_t_2 = NULL;
9647  int __pyx_lineno = 0;
9648  const char *__pyx_filename = NULL;
9649  int __pyx_clineno = 0;
9650  __Pyx_RefNannySetupContext("__getitem__", 0);
9651 
9652  /* "View.MemoryView":237
9653  *
9654  * def __getitem__(self, item):
9655  * return self.memview[item] # <<<<<<<<<<<<<<
9656  *
9657  * def __setitem__(self, item, value):
9658  */
9659  __Pyx_XDECREF(__pyx_r);
9660  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 237, __pyx_L1_error)
9661  __Pyx_GOTREF(__pyx_t_1);
9662  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error)
9663  __Pyx_GOTREF(__pyx_t_2);
9664  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9665  __pyx_r = __pyx_t_2;
9666  __pyx_t_2 = 0;
9667  goto __pyx_L0;
9668 
9669  /* "View.MemoryView":236
9670  * return getattr(self.memview, attr)
9671  *
9672  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9673  * return self.memview[item]
9674  *
9675  */
9676 
9677  /* function exit code */
9678  __pyx_L1_error:;
9679  __Pyx_XDECREF(__pyx_t_1);
9680  __Pyx_XDECREF(__pyx_t_2);
9681  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9682  __pyx_r = NULL;
9683  __pyx_L0:;
9684  __Pyx_XGIVEREF(__pyx_r);
9685  __Pyx_RefNannyFinishContext();
9686  return __pyx_r;
9687 }
9688 
9689 /* "View.MemoryView":239
9690  * return self.memview[item]
9691  *
9692  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9693  * self.memview[item] = value
9694  *
9695  */
9696 
9697 /* Python wrapper */
9698 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
9699 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9700  int __pyx_r;
9701  __Pyx_RefNannyDeclarations
9702  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9703  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
9704 
9705  /* function exit code */
9706  __Pyx_RefNannyFinishContext();
9707  return __pyx_r;
9708 }
9709 
9710 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9711  int __pyx_r;
9712  __Pyx_RefNannyDeclarations
9713  PyObject *__pyx_t_1 = NULL;
9714  int __pyx_lineno = 0;
9715  const char *__pyx_filename = NULL;
9716  int __pyx_clineno = 0;
9717  __Pyx_RefNannySetupContext("__setitem__", 0);
9718 
9719  /* "View.MemoryView":240
9720  *
9721  * def __setitem__(self, item, value):
9722  * self.memview[item] = value # <<<<<<<<<<<<<<
9723  *
9724  *
9725  */
9726  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 240, __pyx_L1_error)
9727  __Pyx_GOTREF(__pyx_t_1);
9728  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 240, __pyx_L1_error)
9729  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9730 
9731  /* "View.MemoryView":239
9732  * return self.memview[item]
9733  *
9734  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9735  * self.memview[item] = value
9736  *
9737  */
9738 
9739  /* function exit code */
9740  __pyx_r = 0;
9741  goto __pyx_L0;
9742  __pyx_L1_error:;
9743  __Pyx_XDECREF(__pyx_t_1);
9744  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9745  __pyx_r = -1;
9746  __pyx_L0:;
9747  __Pyx_RefNannyFinishContext();
9748  return __pyx_r;
9749 }
9750 
9751 /* "(tree fragment)":1
9752  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9753  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9754  * def __setstate_cython__(self, __pyx_state):
9755  */
9756 
9757 /* Python wrapper */
9758 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9759 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9760  PyObject *__pyx_r = 0;
9761  __Pyx_RefNannyDeclarations
9762  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9763  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
9764 
9765  /* function exit code */
9766  __Pyx_RefNannyFinishContext();
9767  return __pyx_r;
9768 }
9769 
9770 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
9771  PyObject *__pyx_r = NULL;
9772  __Pyx_RefNannyDeclarations
9773  PyObject *__pyx_t_1 = NULL;
9774  int __pyx_lineno = 0;
9775  const char *__pyx_filename = NULL;
9776  int __pyx_clineno = 0;
9777  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9778 
9779  /* "(tree fragment)":2
9780  * def __reduce_cython__(self):
9781  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9782  * def __setstate_cython__(self, __pyx_state):
9783  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9784  */
9785  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
9786  __Pyx_GOTREF(__pyx_t_1);
9787  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9788  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9789  __PYX_ERR(2, 2, __pyx_L1_error)
9790 
9791  /* "(tree fragment)":1
9792  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9793  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9794  * def __setstate_cython__(self, __pyx_state):
9795  */
9796 
9797  /* function exit code */
9798  __pyx_L1_error:;
9799  __Pyx_XDECREF(__pyx_t_1);
9800  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9801  __pyx_r = NULL;
9802  __Pyx_XGIVEREF(__pyx_r);
9803  __Pyx_RefNannyFinishContext();
9804  return __pyx_r;
9805 }
9806 
9807 /* "(tree fragment)":3
9808  * def __reduce_cython__(self):
9809  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9810  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9811  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9812  */
9813 
9814 /* Python wrapper */
9815 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9816 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9817  PyObject *__pyx_r = 0;
9818  __Pyx_RefNannyDeclarations
9819  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9820  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9821 
9822  /* function exit code */
9823  __Pyx_RefNannyFinishContext();
9824  return __pyx_r;
9825 }
9826 
9827 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
9828  PyObject *__pyx_r = NULL;
9829  __Pyx_RefNannyDeclarations
9830  PyObject *__pyx_t_1 = NULL;
9831  int __pyx_lineno = 0;
9832  const char *__pyx_filename = NULL;
9833  int __pyx_clineno = 0;
9834  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9835 
9836  /* "(tree fragment)":4
9837  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9838  * def __setstate_cython__(self, __pyx_state):
9839  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9840  */
9841  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
9842  __Pyx_GOTREF(__pyx_t_1);
9843  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9844  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9845  __PYX_ERR(2, 4, __pyx_L1_error)
9846 
9847  /* "(tree fragment)":3
9848  * def __reduce_cython__(self):
9849  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9850  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9851  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9852  */
9853 
9854  /* function exit code */
9855  __pyx_L1_error:;
9856  __Pyx_XDECREF(__pyx_t_1);
9857  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9858  __pyx_r = NULL;
9859  __Pyx_XGIVEREF(__pyx_r);
9860  __Pyx_RefNannyFinishContext();
9861  return __pyx_r;
9862 }
9863 
9864 /* "View.MemoryView":244
9865  *
9866  * @cname("__pyx_array_new")
9867  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9868  * char *mode, char *buf):
9869  * cdef array result
9870  */
9871 
9872 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
9873  struct __pyx_array_obj *__pyx_v_result = 0;
9874  struct __pyx_array_obj *__pyx_r = NULL;
9875  __Pyx_RefNannyDeclarations
9876  int __pyx_t_1;
9877  PyObject *__pyx_t_2 = NULL;
9878  PyObject *__pyx_t_3 = NULL;
9879  PyObject *__pyx_t_4 = NULL;
9880  PyObject *__pyx_t_5 = NULL;
9881  int __pyx_lineno = 0;
9882  const char *__pyx_filename = NULL;
9883  int __pyx_clineno = 0;
9884  __Pyx_RefNannySetupContext("array_cwrapper", 0);
9885 
9886  /* "View.MemoryView":248
9887  * cdef array result
9888  *
9889  * if buf == NULL: # <<<<<<<<<<<<<<
9890  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9891  * else:
9892  */
9893  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9894  if (__pyx_t_1) {
9895 
9896  /* "View.MemoryView":249
9897  *
9898  * if buf == NULL:
9899  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
9900  * else:
9901  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9902  */
9903  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 249, __pyx_L1_error)
9904  __Pyx_GOTREF(__pyx_t_2);
9905  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 249, __pyx_L1_error)
9906  __Pyx_GOTREF(__pyx_t_3);
9907  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
9908  __Pyx_GOTREF(__pyx_t_4);
9909  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 249, __pyx_L1_error)
9910  __Pyx_GOTREF(__pyx_t_5);
9911  __Pyx_INCREF(__pyx_v_shape);
9912  __Pyx_GIVEREF(__pyx_v_shape);
9913  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
9914  __Pyx_GIVEREF(__pyx_t_2);
9915  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9916  __Pyx_GIVEREF(__pyx_t_3);
9917  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
9918  __Pyx_GIVEREF(__pyx_t_4);
9919  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
9920  __pyx_t_2 = 0;
9921  __pyx_t_3 = 0;
9922  __pyx_t_4 = 0;
9923  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
9924  __Pyx_GOTREF(__pyx_t_4);
9925  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9926  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
9927  __pyx_t_4 = 0;
9928 
9929  /* "View.MemoryView":248
9930  * cdef array result
9931  *
9932  * if buf == NULL: # <<<<<<<<<<<<<<
9933  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9934  * else:
9935  */
9936  goto __pyx_L3;
9937  }
9938 
9939  /* "View.MemoryView":251
9940  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9941  * else:
9942  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9943  * allocate_buffer=False)
9944  * result.data = buf
9945  */
9946  /*else*/ {
9947  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 251, __pyx_L1_error)
9948  __Pyx_GOTREF(__pyx_t_4);
9949  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
9950  __Pyx_GOTREF(__pyx_t_5);
9951  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 251, __pyx_L1_error)
9952  __Pyx_GOTREF(__pyx_t_3);
9953  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 251, __pyx_L1_error)
9954  __Pyx_GOTREF(__pyx_t_2);
9955  __Pyx_INCREF(__pyx_v_shape);
9956  __Pyx_GIVEREF(__pyx_v_shape);
9957  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
9958  __Pyx_GIVEREF(__pyx_t_4);
9959  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9960  __Pyx_GIVEREF(__pyx_t_5);
9961  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
9962  __Pyx_GIVEREF(__pyx_t_3);
9963  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
9964  __pyx_t_4 = 0;
9965  __pyx_t_5 = 0;
9966  __pyx_t_3 = 0;
9967 
9968  /* "View.MemoryView":252
9969  * else:
9970  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9971  * allocate_buffer=False) # <<<<<<<<<<<<<<
9972  * result.data = buf
9973  *
9974  */
9975  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error)
9976  __Pyx_GOTREF(__pyx_t_3);
9977  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 252, __pyx_L1_error)
9978 
9979  /* "View.MemoryView":251
9980  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9981  * else:
9982  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9983  * allocate_buffer=False)
9984  * result.data = buf
9985  */
9986  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
9987  __Pyx_GOTREF(__pyx_t_5);
9988  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9989  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9990  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
9991  __pyx_t_5 = 0;
9992 
9993  /* "View.MemoryView":253
9994  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9995  * allocate_buffer=False)
9996  * result.data = buf # <<<<<<<<<<<<<<
9997  *
9998  * return result
9999  */
10000  __pyx_v_result->data = __pyx_v_buf;
10001  }
10002  __pyx_L3:;
10003 
10004  /* "View.MemoryView":255
10005  * result.data = buf
10006  *
10007  * return result # <<<<<<<<<<<<<<
10008  *
10009  *
10010  */
10011  __Pyx_XDECREF(((PyObject *)__pyx_r));
10012  __Pyx_INCREF(((PyObject *)__pyx_v_result));
10013  __pyx_r = __pyx_v_result;
10014  goto __pyx_L0;
10015 
10016  /* "View.MemoryView":244
10017  *
10018  * @cname("__pyx_array_new")
10019  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10020  * char *mode, char *buf):
10021  * cdef array result
10022  */
10023 
10024  /* function exit code */
10025  __pyx_L1_error:;
10026  __Pyx_XDECREF(__pyx_t_2);
10027  __Pyx_XDECREF(__pyx_t_3);
10028  __Pyx_XDECREF(__pyx_t_4);
10029  __Pyx_XDECREF(__pyx_t_5);
10030  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
10031  __pyx_r = 0;
10032  __pyx_L0:;
10033  __Pyx_XDECREF((PyObject *)__pyx_v_result);
10034  __Pyx_XGIVEREF((PyObject *)__pyx_r);
10035  __Pyx_RefNannyFinishContext();
10036  return __pyx_r;
10037 }
10038 
10039 /* "View.MemoryView":281
10040  * cdef class Enum(object):
10041  * cdef object name
10042  * def __init__(self, name): # <<<<<<<<<<<<<<
10043  * self.name = name
10044  * def __repr__(self):
10045  */
10046 
10047 /* Python wrapper */
10048 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10049 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10050  PyObject *__pyx_v_name = 0;
10051  int __pyx_lineno = 0;
10052  const char *__pyx_filename = NULL;
10053  int __pyx_clineno = 0;
10054  int __pyx_r;
10055  __Pyx_RefNannyDeclarations
10056  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
10057  {
10058  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
10059  PyObject* values[1] = {0};
10060  if (unlikely(__pyx_kwds)) {
10061  Py_ssize_t kw_args;
10062  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10063  switch (pos_args) {
10064  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10065  CYTHON_FALLTHROUGH;
10066  case 0: break;
10067  default: goto __pyx_L5_argtuple_error;
10068  }
10069  kw_args = PyDict_Size(__pyx_kwds);
10070  switch (pos_args) {
10071  case 0:
10072  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10073  else goto __pyx_L5_argtuple_error;
10074  }
10075  if (unlikely(kw_args > 0)) {
10076  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 281, __pyx_L3_error)
10077  }
10078  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10079  goto __pyx_L5_argtuple_error;
10080  } else {
10081  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10082  }
10083  __pyx_v_name = values[0];
10084  }
10085  goto __pyx_L4_argument_unpacking_done;
10086  __pyx_L5_argtuple_error:;
10087  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 281, __pyx_L3_error)
10088  __pyx_L3_error:;
10089  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10090  __Pyx_RefNannyFinishContext();
10091  return -1;
10092  __pyx_L4_argument_unpacking_done:;
10093  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10094 
10095  /* function exit code */
10096  __Pyx_RefNannyFinishContext();
10097  return __pyx_r;
10098 }
10099 
10100 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10101  int __pyx_r;
10102  __Pyx_RefNannyDeclarations
10103  __Pyx_RefNannySetupContext("__init__", 0);
10104 
10105  /* "View.MemoryView":282
10106  * cdef object name
10107  * def __init__(self, name):
10108  * self.name = name # <<<<<<<<<<<<<<
10109  * def __repr__(self):
10110  * return self.name
10111  */
10112  __Pyx_INCREF(__pyx_v_name);
10113  __Pyx_GIVEREF(__pyx_v_name);
10114  __Pyx_GOTREF(__pyx_v_self->name);
10115  __Pyx_DECREF(__pyx_v_self->name);
10116  __pyx_v_self->name = __pyx_v_name;
10117 
10118  /* "View.MemoryView":281
10119  * cdef class Enum(object):
10120  * cdef object name
10121  * def __init__(self, name): # <<<<<<<<<<<<<<
10122  * self.name = name
10123  * def __repr__(self):
10124  */
10125 
10126  /* function exit code */
10127  __pyx_r = 0;
10128  __Pyx_RefNannyFinishContext();
10129  return __pyx_r;
10130 }
10131 
10132 /* "View.MemoryView":283
10133  * def __init__(self, name):
10134  * self.name = name
10135  * def __repr__(self): # <<<<<<<<<<<<<<
10136  * return self.name
10137  *
10138  */
10139 
10140 /* Python wrapper */
10141 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
10142 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10143  PyObject *__pyx_r = 0;
10144  __Pyx_RefNannyDeclarations
10145  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
10146  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10147 
10148  /* function exit code */
10149  __Pyx_RefNannyFinishContext();
10150  return __pyx_r;
10151 }
10152 
10153 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10154  PyObject *__pyx_r = NULL;
10155  __Pyx_RefNannyDeclarations
10156  __Pyx_RefNannySetupContext("__repr__", 0);
10157 
10158  /* "View.MemoryView":284
10159  * self.name = name
10160  * def __repr__(self):
10161  * return self.name # <<<<<<<<<<<<<<
10162  *
10163  * cdef generic = Enum("<strided and direct or indirect>")
10164  */
10165  __Pyx_XDECREF(__pyx_r);
10166  __Pyx_INCREF(__pyx_v_self->name);
10167  __pyx_r = __pyx_v_self->name;
10168  goto __pyx_L0;
10169 
10170  /* "View.MemoryView":283
10171  * def __init__(self, name):
10172  * self.name = name
10173  * def __repr__(self): # <<<<<<<<<<<<<<
10174  * return self.name
10175  *
10176  */
10177 
10178  /* function exit code */
10179  __pyx_L0:;
10180  __Pyx_XGIVEREF(__pyx_r);
10181  __Pyx_RefNannyFinishContext();
10182  return __pyx_r;
10183 }
10184 
10185 /* "(tree fragment)":1
10186  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10187  * cdef tuple state
10188  * cdef object _dict
10189  */
10190 
10191 /* Python wrapper */
10192 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10193 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10194  PyObject *__pyx_r = 0;
10195  __Pyx_RefNannyDeclarations
10196  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10197  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10198 
10199  /* function exit code */
10200  __Pyx_RefNannyFinishContext();
10201  return __pyx_r;
10202 }
10203 
10204 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10205  PyObject *__pyx_v_state = 0;
10206  PyObject *__pyx_v__dict = 0;
10207  int __pyx_v_use_setstate;
10208  PyObject *__pyx_r = NULL;
10209  __Pyx_RefNannyDeclarations
10210  PyObject *__pyx_t_1 = NULL;
10211  int __pyx_t_2;
10212  int __pyx_t_3;
10213  PyObject *__pyx_t_4 = NULL;
10214  PyObject *__pyx_t_5 = NULL;
10215  int __pyx_lineno = 0;
10216  const char *__pyx_filename = NULL;
10217  int __pyx_clineno = 0;
10218  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10219 
10220  /* "(tree fragment)":5
10221  * cdef object _dict
10222  * cdef bint use_setstate
10223  * state = (self.name,) # <<<<<<<<<<<<<<
10224  * _dict = getattr(self, '__dict__', None)
10225  * if _dict is not None:
10226  */
10227  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
10228  __Pyx_GOTREF(__pyx_t_1);
10229  __Pyx_INCREF(__pyx_v_self->name);
10230  __Pyx_GIVEREF(__pyx_v_self->name);
10231  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10232  __pyx_v_state = ((PyObject*)__pyx_t_1);
10233  __pyx_t_1 = 0;
10234 
10235  /* "(tree fragment)":6
10236  * cdef bint use_setstate
10237  * state = (self.name,)
10238  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
10239  * if _dict is not None:
10240  * state += (_dict,)
10241  */
10242  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
10243  __Pyx_GOTREF(__pyx_t_1);
10244  __pyx_v__dict = __pyx_t_1;
10245  __pyx_t_1 = 0;
10246 
10247  /* "(tree fragment)":7
10248  * state = (self.name,)
10249  * _dict = getattr(self, '__dict__', None)
10250  * if _dict is not None: # <<<<<<<<<<<<<<
10251  * state += (_dict,)
10252  * use_setstate = True
10253  */
10254  __pyx_t_2 = (__pyx_v__dict != Py_None);
10255  __pyx_t_3 = (__pyx_t_2 != 0);
10256  if (__pyx_t_3) {
10257 
10258  /* "(tree fragment)":8
10259  * _dict = getattr(self, '__dict__', None)
10260  * if _dict is not None:
10261  * state += (_dict,) # <<<<<<<<<<<<<<
10262  * use_setstate = True
10263  * else:
10264  */
10265  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
10266  __Pyx_GOTREF(__pyx_t_1);
10267  __Pyx_INCREF(__pyx_v__dict);
10268  __Pyx_GIVEREF(__pyx_v__dict);
10269  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10270  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
10271  __Pyx_GOTREF(__pyx_t_4);
10272  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10273  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10274  __pyx_t_4 = 0;
10275 
10276  /* "(tree fragment)":9
10277  * if _dict is not None:
10278  * state += (_dict,)
10279  * use_setstate = True # <<<<<<<<<<<<<<
10280  * else:
10281  * use_setstate = self.name is not None
10282  */
10283  __pyx_v_use_setstate = 1;
10284 
10285  /* "(tree fragment)":7
10286  * state = (self.name,)
10287  * _dict = getattr(self, '__dict__', None)
10288  * if _dict is not None: # <<<<<<<<<<<<<<
10289  * state += (_dict,)
10290  * use_setstate = True
10291  */
10292  goto __pyx_L3;
10293  }
10294 
10295  /* "(tree fragment)":11
10296  * use_setstate = True
10297  * else:
10298  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
10299  * if use_setstate:
10300  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10301  */
10302  /*else*/ {
10303  __pyx_t_3 = (__pyx_v_self->name != Py_None);
10304  __pyx_v_use_setstate = __pyx_t_3;
10305  }
10306  __pyx_L3:;
10307 
10308  /* "(tree fragment)":12
10309  * else:
10310  * use_setstate = self.name is not None
10311  * if use_setstate: # <<<<<<<<<<<<<<
10312  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10313  * else:
10314  */
10315  __pyx_t_3 = (__pyx_v_use_setstate != 0);
10316  if (__pyx_t_3) {
10317 
10318  /* "(tree fragment)":13
10319  * use_setstate = self.name is not None
10320  * if use_setstate:
10321  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
10322  * else:
10323  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10324  */
10325  __Pyx_XDECREF(__pyx_r);
10326  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
10327  __Pyx_GOTREF(__pyx_t_4);
10328  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
10329  __Pyx_GOTREF(__pyx_t_1);
10330  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10331  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10332  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10333  __Pyx_INCREF(__pyx_int_184977713);
10334  __Pyx_GIVEREF(__pyx_int_184977713);
10335  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10336  __Pyx_INCREF(Py_None);
10337  __Pyx_GIVEREF(Py_None);
10338  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10339  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
10340  __Pyx_GOTREF(__pyx_t_5);
10341  __Pyx_GIVEREF(__pyx_t_4);
10342  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10343  __Pyx_GIVEREF(__pyx_t_1);
10344  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10345  __Pyx_INCREF(__pyx_v_state);
10346  __Pyx_GIVEREF(__pyx_v_state);
10347  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10348  __pyx_t_4 = 0;
10349  __pyx_t_1 = 0;
10350  __pyx_r = __pyx_t_5;
10351  __pyx_t_5 = 0;
10352  goto __pyx_L0;
10353 
10354  /* "(tree fragment)":12
10355  * else:
10356  * use_setstate = self.name is not None
10357  * if use_setstate: # <<<<<<<<<<<<<<
10358  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10359  * else:
10360  */
10361  }
10362 
10363  /* "(tree fragment)":15
10364  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10365  * else:
10366  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
10367  * def __setstate_cython__(self, __pyx_state):
10368  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10369  */
10370  /*else*/ {
10371  __Pyx_XDECREF(__pyx_r);
10372  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
10373  __Pyx_GOTREF(__pyx_t_5);
10374  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
10375  __Pyx_GOTREF(__pyx_t_1);
10376  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10377  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10378  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10379  __Pyx_INCREF(__pyx_int_184977713);
10380  __Pyx_GIVEREF(__pyx_int_184977713);
10381  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10382  __Pyx_INCREF(__pyx_v_state);
10383  __Pyx_GIVEREF(__pyx_v_state);
10384  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10385  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
10386  __Pyx_GOTREF(__pyx_t_4);
10387  __Pyx_GIVEREF(__pyx_t_5);
10388  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10389  __Pyx_GIVEREF(__pyx_t_1);
10390  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10391  __pyx_t_5 = 0;
10392  __pyx_t_1 = 0;
10393  __pyx_r = __pyx_t_4;
10394  __pyx_t_4 = 0;
10395  goto __pyx_L0;
10396  }
10397 
10398  /* "(tree fragment)":1
10399  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10400  * cdef tuple state
10401  * cdef object _dict
10402  */
10403 
10404  /* function exit code */
10405  __pyx_L1_error:;
10406  __Pyx_XDECREF(__pyx_t_1);
10407  __Pyx_XDECREF(__pyx_t_4);
10408  __Pyx_XDECREF(__pyx_t_5);
10409  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10410  __pyx_r = NULL;
10411  __pyx_L0:;
10412  __Pyx_XDECREF(__pyx_v_state);
10413  __Pyx_XDECREF(__pyx_v__dict);
10414  __Pyx_XGIVEREF(__pyx_r);
10415  __Pyx_RefNannyFinishContext();
10416  return __pyx_r;
10417 }
10418 
10419 /* "(tree fragment)":16
10420  * else:
10421  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10422  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10423  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10424  */
10425 
10426 /* Python wrapper */
10427 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10428 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10429  PyObject *__pyx_r = 0;
10430  __Pyx_RefNannyDeclarations
10431  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10432  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10433 
10434  /* function exit code */
10435  __Pyx_RefNannyFinishContext();
10436  return __pyx_r;
10437 }
10438 
10439 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10440  PyObject *__pyx_r = NULL;
10441  __Pyx_RefNannyDeclarations
10442  PyObject *__pyx_t_1 = NULL;
10443  int __pyx_lineno = 0;
10444  const char *__pyx_filename = NULL;
10445  int __pyx_clineno = 0;
10446  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10447 
10448  /* "(tree fragment)":17
10449  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10450  * def __setstate_cython__(self, __pyx_state):
10451  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
10452  */
10453  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
10454  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
10455  __Pyx_GOTREF(__pyx_t_1);
10456  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10457 
10458  /* "(tree fragment)":16
10459  * else:
10460  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10461  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10462  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10463  */
10464 
10465  /* function exit code */
10466  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10467  goto __pyx_L0;
10468  __pyx_L1_error:;
10469  __Pyx_XDECREF(__pyx_t_1);
10470  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10471  __pyx_r = NULL;
10472  __pyx_L0:;
10473  __Pyx_XGIVEREF(__pyx_r);
10474  __Pyx_RefNannyFinishContext();
10475  return __pyx_r;
10476 }
10477 
10478 /* "View.MemoryView":298
10479  *
10480  * @cname('__pyx_align_pointer')
10481  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10482  * "Align pointer memory on a given boundary"
10483  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10484  */
10485 
10486 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
10487  Py_intptr_t __pyx_v_aligned_p;
10488  size_t __pyx_v_offset;
10489  void *__pyx_r;
10490  int __pyx_t_1;
10491 
10492  /* "View.MemoryView":300
10493  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
10494  * "Align pointer memory on a given boundary"
10495  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
10496  * cdef size_t offset
10497  *
10498  */
10499  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10500 
10501  /* "View.MemoryView":304
10502  *
10503  * with cython.cdivision(True):
10504  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
10505  *
10506  * if offset > 0:
10507  */
10508  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10509 
10510  /* "View.MemoryView":306
10511  * offset = aligned_p % alignment
10512  *
10513  * if offset > 0: # <<<<<<<<<<<<<<
10514  * aligned_p += alignment - offset
10515  *
10516  */
10517  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10518  if (__pyx_t_1) {
10519 
10520  /* "View.MemoryView":307
10521  *
10522  * if offset > 0:
10523  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
10524  *
10525  * return <void *> aligned_p
10526  */
10527  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10528 
10529  /* "View.MemoryView":306
10530  * offset = aligned_p % alignment
10531  *
10532  * if offset > 0: # <<<<<<<<<<<<<<
10533  * aligned_p += alignment - offset
10534  *
10535  */
10536  }
10537 
10538  /* "View.MemoryView":309
10539  * aligned_p += alignment - offset
10540  *
10541  * return <void *> aligned_p # <<<<<<<<<<<<<<
10542  *
10543  *
10544  */
10545  __pyx_r = ((void *)__pyx_v_aligned_p);
10546  goto __pyx_L0;
10547 
10548  /* "View.MemoryView":298
10549  *
10550  * @cname('__pyx_align_pointer')
10551  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10552  * "Align pointer memory on a given boundary"
10553  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10554  */
10555 
10556  /* function exit code */
10557  __pyx_L0:;
10558  return __pyx_r;
10559 }
10560 
10561 /* "View.MemoryView":345
10562  * cdef __Pyx_TypeInfo *typeinfo
10563  *
10564  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10565  * self.obj = obj
10566  * self.flags = flags
10567  */
10568 
10569 /* Python wrapper */
10570 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10571 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10572  PyObject *__pyx_v_obj = 0;
10573  int __pyx_v_flags;
10574  int __pyx_v_dtype_is_object;
10575  int __pyx_lineno = 0;
10576  const char *__pyx_filename = NULL;
10577  int __pyx_clineno = 0;
10578  int __pyx_r;
10579  __Pyx_RefNannyDeclarations
10580  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10581  {
10582  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10583  PyObject* values[3] = {0,0,0};
10584  if (unlikely(__pyx_kwds)) {
10585  Py_ssize_t kw_args;
10586  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10587  switch (pos_args) {
10588  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10589  CYTHON_FALLTHROUGH;
10590  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10591  CYTHON_FALLTHROUGH;
10592  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10593  CYTHON_FALLTHROUGH;
10594  case 0: break;
10595  default: goto __pyx_L5_argtuple_error;
10596  }
10597  kw_args = PyDict_Size(__pyx_kwds);
10598  switch (pos_args) {
10599  case 0:
10600  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10601  else goto __pyx_L5_argtuple_error;
10602  CYTHON_FALLTHROUGH;
10603  case 1:
10604  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10605  else {
10606  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 345, __pyx_L3_error)
10607  }
10608  CYTHON_FALLTHROUGH;
10609  case 2:
10610  if (kw_args > 0) {
10611  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10612  if (value) { values[2] = value; kw_args--; }
10613  }
10614  }
10615  if (unlikely(kw_args > 0)) {
10616  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 345, __pyx_L3_error)
10617  }
10618  } else {
10619  switch (PyTuple_GET_SIZE(__pyx_args)) {
10620  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10621  CYTHON_FALLTHROUGH;
10622  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10623  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10624  break;
10625  default: goto __pyx_L5_argtuple_error;
10626  }
10627  }
10628  __pyx_v_obj = values[0];
10629  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
10630  if (values[2]) {
10631  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
10632  } else {
10633  __pyx_v_dtype_is_object = ((int)0);
10634  }
10635  }
10636  goto __pyx_L4_argument_unpacking_done;
10637  __pyx_L5_argtuple_error:;
10638  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 345, __pyx_L3_error)
10639  __pyx_L3_error:;
10640  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10641  __Pyx_RefNannyFinishContext();
10642  return -1;
10643  __pyx_L4_argument_unpacking_done:;
10644  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
10645 
10646  /* function exit code */
10647  __Pyx_RefNannyFinishContext();
10648  return __pyx_r;
10649 }
10650 
10651 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
10652  int __pyx_r;
10653  __Pyx_RefNannyDeclarations
10654  int __pyx_t_1;
10655  int __pyx_t_2;
10656  int __pyx_t_3;
10657  int __pyx_t_4;
10658  int __pyx_lineno = 0;
10659  const char *__pyx_filename = NULL;
10660  int __pyx_clineno = 0;
10661  __Pyx_RefNannySetupContext("__cinit__", 0);
10662 
10663  /* "View.MemoryView":346
10664  *
10665  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10666  * self.obj = obj # <<<<<<<<<<<<<<
10667  * self.flags = flags
10668  * if type(self) is memoryview or obj is not None:
10669  */
10670  __Pyx_INCREF(__pyx_v_obj);
10671  __Pyx_GIVEREF(__pyx_v_obj);
10672  __Pyx_GOTREF(__pyx_v_self->obj);
10673  __Pyx_DECREF(__pyx_v_self->obj);
10674  __pyx_v_self->obj = __pyx_v_obj;
10675 
10676  /* "View.MemoryView":347
10677  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10678  * self.obj = obj
10679  * self.flags = flags # <<<<<<<<<<<<<<
10680  * if type(self) is memoryview or obj is not None:
10681  * __Pyx_GetBuffer(obj, &self.view, flags)
10682  */
10683  __pyx_v_self->flags = __pyx_v_flags;
10684 
10685  /* "View.MemoryView":348
10686  * self.obj = obj
10687  * self.flags = flags
10688  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10689  * __Pyx_GetBuffer(obj, &self.view, flags)
10690  * if <PyObject *> self.view.obj == NULL:
10691  */
10692  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10693  __pyx_t_3 = (__pyx_t_2 != 0);
10694  if (!__pyx_t_3) {
10695  } else {
10696  __pyx_t_1 = __pyx_t_3;
10697  goto __pyx_L4_bool_binop_done;
10698  }
10699  __pyx_t_3 = (__pyx_v_obj != Py_None);
10700  __pyx_t_2 = (__pyx_t_3 != 0);
10701  __pyx_t_1 = __pyx_t_2;
10702  __pyx_L4_bool_binop_done:;
10703  if (__pyx_t_1) {
10704 
10705  /* "View.MemoryView":349
10706  * self.flags = flags
10707  * if type(self) is memoryview or obj is not None:
10708  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
10709  * if <PyObject *> self.view.obj == NULL:
10710  * (<__pyx_buffer *> &self.view).obj = Py_None
10711  */
10712  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 349, __pyx_L1_error)
10713 
10714  /* "View.MemoryView":350
10715  * if type(self) is memoryview or obj is not None:
10716  * __Pyx_GetBuffer(obj, &self.view, flags)
10717  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10718  * (<__pyx_buffer *> &self.view).obj = Py_None
10719  * Py_INCREF(Py_None)
10720  */
10721  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10722  if (__pyx_t_1) {
10723 
10724  /* "View.MemoryView":351
10725  * __Pyx_GetBuffer(obj, &self.view, flags)
10726  * if <PyObject *> self.view.obj == NULL:
10727  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
10728  * Py_INCREF(Py_None)
10729  *
10730  */
10731  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10732 
10733  /* "View.MemoryView":352
10734  * if <PyObject *> self.view.obj == NULL:
10735  * (<__pyx_buffer *> &self.view).obj = Py_None
10736  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
10737  *
10738  * global __pyx_memoryview_thread_locks_used
10739  */
10740  Py_INCREF(Py_None);
10741 
10742  /* "View.MemoryView":350
10743  * if type(self) is memoryview or obj is not None:
10744  * __Pyx_GetBuffer(obj, &self.view, flags)
10745  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10746  * (<__pyx_buffer *> &self.view).obj = Py_None
10747  * Py_INCREF(Py_None)
10748  */
10749  }
10750 
10751  /* "View.MemoryView":348
10752  * self.obj = obj
10753  * self.flags = flags
10754  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10755  * __Pyx_GetBuffer(obj, &self.view, flags)
10756  * if <PyObject *> self.view.obj == NULL:
10757  */
10758  }
10759 
10760  /* "View.MemoryView":355
10761  *
10762  * global __pyx_memoryview_thread_locks_used
10763  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10764  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10765  * __pyx_memoryview_thread_locks_used += 1
10766  */
10767  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10768  if (__pyx_t_1) {
10769 
10770  /* "View.MemoryView":356
10771  * global __pyx_memoryview_thread_locks_used
10772  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10773  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
10774  * __pyx_memoryview_thread_locks_used += 1
10775  * if self.lock is NULL:
10776  */
10777  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10778 
10779  /* "View.MemoryView":357
10780  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10781  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10782  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
10783  * if self.lock is NULL:
10784  * self.lock = PyThread_allocate_lock()
10785  */
10786  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10787 
10788  /* "View.MemoryView":355
10789  *
10790  * global __pyx_memoryview_thread_locks_used
10791  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10792  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10793  * __pyx_memoryview_thread_locks_used += 1
10794  */
10795  }
10796 
10797  /* "View.MemoryView":358
10798  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10799  * __pyx_memoryview_thread_locks_used += 1
10800  * if self.lock is NULL: # <<<<<<<<<<<<<<
10801  * self.lock = PyThread_allocate_lock()
10802  * if self.lock is NULL:
10803  */
10804  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10805  if (__pyx_t_1) {
10806 
10807  /* "View.MemoryView":359
10808  * __pyx_memoryview_thread_locks_used += 1
10809  * if self.lock is NULL:
10810  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
10811  * if self.lock is NULL:
10812  * raise MemoryError
10813  */
10814  __pyx_v_self->lock = PyThread_allocate_lock();
10815 
10816  /* "View.MemoryView":360
10817  * if self.lock is NULL:
10818  * self.lock = PyThread_allocate_lock()
10819  * if self.lock is NULL: # <<<<<<<<<<<<<<
10820  * raise MemoryError
10821  *
10822  */
10823  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10824  if (unlikely(__pyx_t_1)) {
10825 
10826  /* "View.MemoryView":361
10827  * self.lock = PyThread_allocate_lock()
10828  * if self.lock is NULL:
10829  * raise MemoryError # <<<<<<<<<<<<<<
10830  *
10831  * if flags & PyBUF_FORMAT:
10832  */
10833  PyErr_NoMemory(); __PYX_ERR(2, 361, __pyx_L1_error)
10834 
10835  /* "View.MemoryView":360
10836  * if self.lock is NULL:
10837  * self.lock = PyThread_allocate_lock()
10838  * if self.lock is NULL: # <<<<<<<<<<<<<<
10839  * raise MemoryError
10840  *
10841  */
10842  }
10843 
10844  /* "View.MemoryView":358
10845  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10846  * __pyx_memoryview_thread_locks_used += 1
10847  * if self.lock is NULL: # <<<<<<<<<<<<<<
10848  * self.lock = PyThread_allocate_lock()
10849  * if self.lock is NULL:
10850  */
10851  }
10852 
10853  /* "View.MemoryView":363
10854  * raise MemoryError
10855  *
10856  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10857  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10858  * else:
10859  */
10860  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10861  if (__pyx_t_1) {
10862 
10863  /* "View.MemoryView":364
10864  *
10865  * if flags & PyBUF_FORMAT:
10866  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
10867  * else:
10868  * self.dtype_is_object = dtype_is_object
10869  */
10870  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
10871  if (__pyx_t_2) {
10872  } else {
10873  __pyx_t_1 = __pyx_t_2;
10874  goto __pyx_L11_bool_binop_done;
10875  }
10876  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
10877  __pyx_t_1 = __pyx_t_2;
10878  __pyx_L11_bool_binop_done:;
10879  __pyx_v_self->dtype_is_object = __pyx_t_1;
10880 
10881  /* "View.MemoryView":363
10882  * raise MemoryError
10883  *
10884  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10885  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10886  * else:
10887  */
10888  goto __pyx_L10;
10889  }
10890 
10891  /* "View.MemoryView":366
10892  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10893  * else:
10894  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
10895  *
10896  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10897  */
10898  /*else*/ {
10899  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10900  }
10901  __pyx_L10:;
10902 
10903  /* "View.MemoryView":368
10904  * self.dtype_is_object = dtype_is_object
10905  *
10906  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
10907  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10908  * self.typeinfo = NULL
10909  */
10910  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
10911 
10912  /* "View.MemoryView":370
10913  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10914  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10915  * self.typeinfo = NULL # <<<<<<<<<<<<<<
10916  *
10917  * def __dealloc__(memoryview self):
10918  */
10919  __pyx_v_self->typeinfo = NULL;
10920 
10921  /* "View.MemoryView":345
10922  * cdef __Pyx_TypeInfo *typeinfo
10923  *
10924  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10925  * self.obj = obj
10926  * self.flags = flags
10927  */
10928 
10929  /* function exit code */
10930  __pyx_r = 0;
10931  goto __pyx_L0;
10932  __pyx_L1_error:;
10933  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10934  __pyx_r = -1;
10935  __pyx_L0:;
10936  __Pyx_RefNannyFinishContext();
10937  return __pyx_r;
10938 }
10939 
10940 /* "View.MemoryView":372
10941  * self.typeinfo = NULL
10942  *
10943  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10944  * if self.obj is not None:
10945  * __Pyx_ReleaseBuffer(&self.view)
10946  */
10947 
10948 /* Python wrapper */
10949 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
10950 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10951  __Pyx_RefNannyDeclarations
10952  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10953  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10954 
10955  /* function exit code */
10956  __Pyx_RefNannyFinishContext();
10957 }
10958 
10959 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
10960  int __pyx_v_i;
10961  __Pyx_RefNannyDeclarations
10962  int __pyx_t_1;
10963  int __pyx_t_2;
10964  int __pyx_t_3;
10965  int __pyx_t_4;
10966  int __pyx_t_5;
10967  PyThread_type_lock __pyx_t_6;
10968  PyThread_type_lock __pyx_t_7;
10969  __Pyx_RefNannySetupContext("__dealloc__", 0);
10970 
10971  /* "View.MemoryView":373
10972  *
10973  * def __dealloc__(memoryview self):
10974  * if self.obj is not None: # <<<<<<<<<<<<<<
10975  * __Pyx_ReleaseBuffer(&self.view)
10976  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10977  */
10978  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10979  __pyx_t_2 = (__pyx_t_1 != 0);
10980  if (__pyx_t_2) {
10981 
10982  /* "View.MemoryView":374
10983  * def __dealloc__(memoryview self):
10984  * if self.obj is not None:
10985  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
10986  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10987  *
10988  */
10989  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10990 
10991  /* "View.MemoryView":373
10992  *
10993  * def __dealloc__(memoryview self):
10994  * if self.obj is not None: # <<<<<<<<<<<<<<
10995  * __Pyx_ReleaseBuffer(&self.view)
10996  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10997  */
10998  goto __pyx_L3;
10999  }
11000 
11001  /* "View.MemoryView":375
11002  * if self.obj is not None:
11003  * __Pyx_ReleaseBuffer(&self.view)
11004  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
11005  *
11006  * (<__pyx_buffer *> &self.view).obj = NULL
11007  */
11008  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
11009  if (__pyx_t_2) {
11010 
11011  /* "View.MemoryView":377
11012  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11013  *
11014  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
11015  * Py_DECREF(Py_None)
11016  *
11017  */
11018  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
11019 
11020  /* "View.MemoryView":378
11021  *
11022  * (<__pyx_buffer *> &self.view).obj = NULL
11023  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
11024  *
11025  * cdef int i
11026  */
11027  Py_DECREF(Py_None);
11028 
11029  /* "View.MemoryView":375
11030  * if self.obj is not None:
11031  * __Pyx_ReleaseBuffer(&self.view)
11032  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
11033  *
11034  * (<__pyx_buffer *> &self.view).obj = NULL
11035  */
11036  }
11037  __pyx_L3:;
11038 
11039  /* "View.MemoryView":382
11040  * cdef int i
11041  * global __pyx_memoryview_thread_locks_used
11042  * if self.lock != NULL: # <<<<<<<<<<<<<<
11043  * for i in range(__pyx_memoryview_thread_locks_used):
11044  * if __pyx_memoryview_thread_locks[i] is self.lock:
11045  */
11046  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
11047  if (__pyx_t_2) {
11048 
11049  /* "View.MemoryView":383
11050  * global __pyx_memoryview_thread_locks_used
11051  * if self.lock != NULL:
11052  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
11053  * if __pyx_memoryview_thread_locks[i] is self.lock:
11054  * __pyx_memoryview_thread_locks_used -= 1
11055  */
11056  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
11057  __pyx_t_4 = __pyx_t_3;
11058  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
11059  __pyx_v_i = __pyx_t_5;
11060 
11061  /* "View.MemoryView":384
11062  * if self.lock != NULL:
11063  * for i in range(__pyx_memoryview_thread_locks_used):
11064  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11065  * __pyx_memoryview_thread_locks_used -= 1
11066  * if i != __pyx_memoryview_thread_locks_used:
11067  */
11068  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11069  if (__pyx_t_2) {
11070 
11071  /* "View.MemoryView":385
11072  * for i in range(__pyx_memoryview_thread_locks_used):
11073  * if __pyx_memoryview_thread_locks[i] is self.lock:
11074  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
11075  * if i != __pyx_memoryview_thread_locks_used:
11076  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11077  */
11078  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11079 
11080  /* "View.MemoryView":386
11081  * if __pyx_memoryview_thread_locks[i] is self.lock:
11082  * __pyx_memoryview_thread_locks_used -= 1
11083  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11084  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11085  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11086  */
11087  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11088  if (__pyx_t_2) {
11089 
11090  /* "View.MemoryView":388
11091  * if i != __pyx_memoryview_thread_locks_used:
11092  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11093  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
11094  * break
11095  * else:
11096  */
11097  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11098  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11099 
11100  /* "View.MemoryView":387
11101  * __pyx_memoryview_thread_locks_used -= 1
11102  * if i != __pyx_memoryview_thread_locks_used:
11103  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
11104  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11105  * break
11106  */
11107  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11108  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11109 
11110  /* "View.MemoryView":386
11111  * if __pyx_memoryview_thread_locks[i] is self.lock:
11112  * __pyx_memoryview_thread_locks_used -= 1
11113  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11114  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11115  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11116  */
11117  }
11118 
11119  /* "View.MemoryView":389
11120  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11121  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11122  * break # <<<<<<<<<<<<<<
11123  * else:
11124  * PyThread_free_lock(self.lock)
11125  */
11126  goto __pyx_L6_break;
11127 
11128  /* "View.MemoryView":384
11129  * if self.lock != NULL:
11130  * for i in range(__pyx_memoryview_thread_locks_used):
11131  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11132  * __pyx_memoryview_thread_locks_used -= 1
11133  * if i != __pyx_memoryview_thread_locks_used:
11134  */
11135  }
11136  }
11137  /*else*/ {
11138 
11139  /* "View.MemoryView":391
11140  * break
11141  * else:
11142  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
11143  *
11144  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11145  */
11146  PyThread_free_lock(__pyx_v_self->lock);
11147  }
11148  __pyx_L6_break:;
11149 
11150  /* "View.MemoryView":382
11151  * cdef int i
11152  * global __pyx_memoryview_thread_locks_used
11153  * if self.lock != NULL: # <<<<<<<<<<<<<<
11154  * for i in range(__pyx_memoryview_thread_locks_used):
11155  * if __pyx_memoryview_thread_locks[i] is self.lock:
11156  */
11157  }
11158 
11159  /* "View.MemoryView":372
11160  * self.typeinfo = NULL
11161  *
11162  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11163  * if self.obj is not None:
11164  * __Pyx_ReleaseBuffer(&self.view)
11165  */
11166 
11167  /* function exit code */
11168  __Pyx_RefNannyFinishContext();
11169 }
11170 
11171 /* "View.MemoryView":393
11172  * PyThread_free_lock(self.lock)
11173  *
11174  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11175  * cdef Py_ssize_t dim
11176  * cdef char *itemp = <char *> self.view.buf
11177  */
11178 
11179 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11180  Py_ssize_t __pyx_v_dim;
11181  char *__pyx_v_itemp;
11182  PyObject *__pyx_v_idx = NULL;
11183  char *__pyx_r;
11184  __Pyx_RefNannyDeclarations
11185  Py_ssize_t __pyx_t_1;
11186  PyObject *__pyx_t_2 = NULL;
11187  Py_ssize_t __pyx_t_3;
11188  PyObject *(*__pyx_t_4)(PyObject *);
11189  PyObject *__pyx_t_5 = NULL;
11190  Py_ssize_t __pyx_t_6;
11191  char *__pyx_t_7;
11192  int __pyx_lineno = 0;
11193  const char *__pyx_filename = NULL;
11194  int __pyx_clineno = 0;
11195  __Pyx_RefNannySetupContext("get_item_pointer", 0);
11196 
11197  /* "View.MemoryView":395
11198  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11199  * cdef Py_ssize_t dim
11200  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
11201  *
11202  * for dim, idx in enumerate(index):
11203  */
11204  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
11205 
11206  /* "View.MemoryView":397
11207  * cdef char *itemp = <char *> self.view.buf
11208  *
11209  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11210  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11211  *
11212  */
11213  __pyx_t_1 = 0;
11214  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11215  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11216  __pyx_t_4 = NULL;
11217  } else {
11218  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 397, __pyx_L1_error)
11219  __Pyx_GOTREF(__pyx_t_2);
11220  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 397, __pyx_L1_error)
11221  }
11222  for (;;) {
11223  if (likely(!__pyx_t_4)) {
11224  if (likely(PyList_CheckExact(__pyx_t_2))) {
11225  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
11226  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11227  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error)
11228  #else
11229  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
11230  __Pyx_GOTREF(__pyx_t_5);
11231  #endif
11232  } else {
11233  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11234  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11235  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error)
11236  #else
11237  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
11238  __Pyx_GOTREF(__pyx_t_5);
11239  #endif
11240  }
11241  } else {
11242  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11243  if (unlikely(!__pyx_t_5)) {
11244  PyObject* exc_type = PyErr_Occurred();
11245  if (exc_type) {
11246  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11247  else __PYX_ERR(2, 397, __pyx_L1_error)
11248  }
11249  break;
11250  }
11251  __Pyx_GOTREF(__pyx_t_5);
11252  }
11253  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11254  __pyx_t_5 = 0;
11255  __pyx_v_dim = __pyx_t_1;
11256  __pyx_t_1 = (__pyx_t_1 + 1);
11257 
11258  /* "View.MemoryView":398
11259  *
11260  * for dim, idx in enumerate(index):
11261  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
11262  *
11263  * return itemp
11264  */
11265  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 398, __pyx_L1_error)
11266  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 398, __pyx_L1_error)
11267  __pyx_v_itemp = __pyx_t_7;
11268 
11269  /* "View.MemoryView":397
11270  * cdef char *itemp = <char *> self.view.buf
11271  *
11272  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11273  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11274  *
11275  */
11276  }
11277  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11278 
11279  /* "View.MemoryView":400
11280  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11281  *
11282  * return itemp # <<<<<<<<<<<<<<
11283  *
11284  *
11285  */
11286  __pyx_r = __pyx_v_itemp;
11287  goto __pyx_L0;
11288 
11289  /* "View.MemoryView":393
11290  * PyThread_free_lock(self.lock)
11291  *
11292  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11293  * cdef Py_ssize_t dim
11294  * cdef char *itemp = <char *> self.view.buf
11295  */
11296 
11297  /* function exit code */
11298  __pyx_L1_error:;
11299  __Pyx_XDECREF(__pyx_t_2);
11300  __Pyx_XDECREF(__pyx_t_5);
11301  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11302  __pyx_r = NULL;
11303  __pyx_L0:;
11304  __Pyx_XDECREF(__pyx_v_idx);
11305  __Pyx_RefNannyFinishContext();
11306  return __pyx_r;
11307 }
11308 
11309 /* "View.MemoryView":403
11310  *
11311  *
11312  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11313  * if index is Ellipsis:
11314  * return self
11315  */
11316 
11317 /* Python wrapper */
11318 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
11319 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11320  PyObject *__pyx_r = 0;
11321  __Pyx_RefNannyDeclarations
11322  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
11323  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11324 
11325  /* function exit code */
11326  __Pyx_RefNannyFinishContext();
11327  return __pyx_r;
11328 }
11329 
11330 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11331  PyObject *__pyx_v_have_slices = NULL;
11332  PyObject *__pyx_v_indices = NULL;
11333  char *__pyx_v_itemp;
11334  PyObject *__pyx_r = NULL;
11335  __Pyx_RefNannyDeclarations
11336  int __pyx_t_1;
11337  int __pyx_t_2;
11338  PyObject *__pyx_t_3 = NULL;
11339  PyObject *__pyx_t_4 = NULL;
11340  PyObject *__pyx_t_5 = NULL;
11341  char *__pyx_t_6;
11342  int __pyx_lineno = 0;
11343  const char *__pyx_filename = NULL;
11344  int __pyx_clineno = 0;
11345  __Pyx_RefNannySetupContext("__getitem__", 0);
11346 
11347  /* "View.MemoryView":404
11348  *
11349  * def __getitem__(memoryview self, object index):
11350  * if index is Ellipsis: # <<<<<<<<<<<<<<
11351  * return self
11352  *
11353  */
11354  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11355  __pyx_t_2 = (__pyx_t_1 != 0);
11356  if (__pyx_t_2) {
11357 
11358  /* "View.MemoryView":405
11359  * def __getitem__(memoryview self, object index):
11360  * if index is Ellipsis:
11361  * return self # <<<<<<<<<<<<<<
11362  *
11363  * have_slices, indices = _unellipsify(index, self.view.ndim)
11364  */
11365  __Pyx_XDECREF(__pyx_r);
11366  __Pyx_INCREF(((PyObject *)__pyx_v_self));
11367  __pyx_r = ((PyObject *)__pyx_v_self);
11368  goto __pyx_L0;
11369 
11370  /* "View.MemoryView":404
11371  *
11372  * def __getitem__(memoryview self, object index):
11373  * if index is Ellipsis: # <<<<<<<<<<<<<<
11374  * return self
11375  *
11376  */
11377  }
11378 
11379  /* "View.MemoryView":407
11380  * return self
11381  *
11382  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11383  *
11384  * cdef char *itemp
11385  */
11386  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 407, __pyx_L1_error)
11387  __Pyx_GOTREF(__pyx_t_3);
11388  if (likely(__pyx_t_3 != Py_None)) {
11389  PyObject* sequence = __pyx_t_3;
11390  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11391  if (unlikely(size != 2)) {
11392  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11393  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11394  __PYX_ERR(2, 407, __pyx_L1_error)
11395  }
11396  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11397  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11398  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11399  __Pyx_INCREF(__pyx_t_4);
11400  __Pyx_INCREF(__pyx_t_5);
11401  #else
11402  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 407, __pyx_L1_error)
11403  __Pyx_GOTREF(__pyx_t_4);
11404  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 407, __pyx_L1_error)
11405  __Pyx_GOTREF(__pyx_t_5);
11406  #endif
11407  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11408  } else {
11409  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 407, __pyx_L1_error)
11410  }
11411  __pyx_v_have_slices = __pyx_t_4;
11412  __pyx_t_4 = 0;
11413  __pyx_v_indices = __pyx_t_5;
11414  __pyx_t_5 = 0;
11415 
11416  /* "View.MemoryView":410
11417  *
11418  * cdef char *itemp
11419  * if have_slices: # <<<<<<<<<<<<<<
11420  * return memview_slice(self, indices)
11421  * else:
11422  */
11423  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 410, __pyx_L1_error)
11424  if (__pyx_t_2) {
11425 
11426  /* "View.MemoryView":411
11427  * cdef char *itemp
11428  * if have_slices:
11429  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
11430  * else:
11431  * itemp = self.get_item_pointer(indices)
11432  */
11433  __Pyx_XDECREF(__pyx_r);
11434  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 411, __pyx_L1_error)
11435  __Pyx_GOTREF(__pyx_t_3);
11436  __pyx_r = __pyx_t_3;
11437  __pyx_t_3 = 0;
11438  goto __pyx_L0;
11439 
11440  /* "View.MemoryView":410
11441  *
11442  * cdef char *itemp
11443  * if have_slices: # <<<<<<<<<<<<<<
11444  * return memview_slice(self, indices)
11445  * else:
11446  */
11447  }
11448 
11449  /* "View.MemoryView":413
11450  * return memview_slice(self, indices)
11451  * else:
11452  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
11453  * return self.convert_item_to_object(itemp)
11454  *
11455  */
11456  /*else*/ {
11457  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 413, __pyx_L1_error)
11458  __pyx_v_itemp = __pyx_t_6;
11459 
11460  /* "View.MemoryView":414
11461  * else:
11462  * itemp = self.get_item_pointer(indices)
11463  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
11464  *
11465  * def __setitem__(memoryview self, object index, object value):
11466  */
11467  __Pyx_XDECREF(__pyx_r);
11468  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error)
11469  __Pyx_GOTREF(__pyx_t_3);
11470  __pyx_r = __pyx_t_3;
11471  __pyx_t_3 = 0;
11472  goto __pyx_L0;
11473  }
11474 
11475  /* "View.MemoryView":403
11476  *
11477  *
11478  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11479  * if index is Ellipsis:
11480  * return self
11481  */
11482 
11483  /* function exit code */
11484  __pyx_L1_error:;
11485  __Pyx_XDECREF(__pyx_t_3);
11486  __Pyx_XDECREF(__pyx_t_4);
11487  __Pyx_XDECREF(__pyx_t_5);
11488  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11489  __pyx_r = NULL;
11490  __pyx_L0:;
11491  __Pyx_XDECREF(__pyx_v_have_slices);
11492  __Pyx_XDECREF(__pyx_v_indices);
11493  __Pyx_XGIVEREF(__pyx_r);
11494  __Pyx_RefNannyFinishContext();
11495  return __pyx_r;
11496 }
11497 
11498 /* "View.MemoryView":416
11499  * return self.convert_item_to_object(itemp)
11500  *
11501  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11502  * if self.view.readonly:
11503  * raise TypeError("Cannot assign to read-only memoryview")
11504  */
11505 
11506 /* Python wrapper */
11507 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
11508 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11509  int __pyx_r;
11510  __Pyx_RefNannyDeclarations
11511  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
11512  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
11513 
11514  /* function exit code */
11515  __Pyx_RefNannyFinishContext();
11516  return __pyx_r;
11517 }
11518 
11519 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11520  PyObject *__pyx_v_have_slices = NULL;
11521  PyObject *__pyx_v_obj = NULL;
11522  int __pyx_r;
11523  __Pyx_RefNannyDeclarations
11524  int __pyx_t_1;
11525  PyObject *__pyx_t_2 = NULL;
11526  PyObject *__pyx_t_3 = NULL;
11527  PyObject *__pyx_t_4 = NULL;
11528  int __pyx_lineno = 0;
11529  const char *__pyx_filename = NULL;
11530  int __pyx_clineno = 0;
11531  __Pyx_RefNannySetupContext("__setitem__", 0);
11532  __Pyx_INCREF(__pyx_v_index);
11533 
11534  /* "View.MemoryView":417
11535  *
11536  * def __setitem__(memoryview self, object index, object value):
11537  * if self.view.readonly: # <<<<<<<<<<<<<<
11538  * raise TypeError("Cannot assign to read-only memoryview")
11539  *
11540  */
11541  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11542  if (unlikely(__pyx_t_1)) {
11543 
11544  /* "View.MemoryView":418
11545  * def __setitem__(memoryview self, object index, object value):
11546  * if self.view.readonly:
11547  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
11548  *
11549  * have_slices, index = _unellipsify(index, self.view.ndim)
11550  */
11551  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error)
11552  __Pyx_GOTREF(__pyx_t_2);
11553  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11554  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11555  __PYX_ERR(2, 418, __pyx_L1_error)
11556 
11557  /* "View.MemoryView":417
11558  *
11559  * def __setitem__(memoryview self, object index, object value):
11560  * if self.view.readonly: # <<<<<<<<<<<<<<
11561  * raise TypeError("Cannot assign to read-only memoryview")
11562  *
11563  */
11564  }
11565 
11566  /* "View.MemoryView":420
11567  * raise TypeError("Cannot assign to read-only memoryview")
11568  *
11569  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11570  *
11571  * if have_slices:
11572  */
11573  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error)
11574  __Pyx_GOTREF(__pyx_t_2);
11575  if (likely(__pyx_t_2 != Py_None)) {
11576  PyObject* sequence = __pyx_t_2;
11577  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11578  if (unlikely(size != 2)) {
11579  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11580  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11581  __PYX_ERR(2, 420, __pyx_L1_error)
11582  }
11583  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11584  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11585  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11586  __Pyx_INCREF(__pyx_t_3);
11587  __Pyx_INCREF(__pyx_t_4);
11588  #else
11589  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 420, __pyx_L1_error)
11590  __Pyx_GOTREF(__pyx_t_3);
11591  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 420, __pyx_L1_error)
11592  __Pyx_GOTREF(__pyx_t_4);
11593  #endif
11594  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11595  } else {
11596  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 420, __pyx_L1_error)
11597  }
11598  __pyx_v_have_slices = __pyx_t_3;
11599  __pyx_t_3 = 0;
11600  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11601  __pyx_t_4 = 0;
11602 
11603  /* "View.MemoryView":422
11604  * have_slices, index = _unellipsify(index, self.view.ndim)
11605  *
11606  * if have_slices: # <<<<<<<<<<<<<<
11607  * obj = self.is_slice(value)
11608  * if obj:
11609  */
11610  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 422, __pyx_L1_error)
11611  if (__pyx_t_1) {
11612 
11613  /* "View.MemoryView":423
11614  *
11615  * if have_slices:
11616  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
11617  * if obj:
11618  * self.setitem_slice_assignment(self[index], obj)
11619  */
11620  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 423, __pyx_L1_error)
11621  __Pyx_GOTREF(__pyx_t_2);
11622  __pyx_v_obj = __pyx_t_2;
11623  __pyx_t_2 = 0;
11624 
11625  /* "View.MemoryView":424
11626  * if have_slices:
11627  * obj = self.is_slice(value)
11628  * if obj: # <<<<<<<<<<<<<<
11629  * self.setitem_slice_assignment(self[index], obj)
11630  * else:
11631  */
11632  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error)
11633  if (__pyx_t_1) {
11634 
11635  /* "View.MemoryView":425
11636  * obj = self.is_slice(value)
11637  * if obj:
11638  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
11639  * else:
11640  * self.setitem_slice_assign_scalar(self[index], value)
11641  */
11642  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error)
11643  __Pyx_GOTREF(__pyx_t_2);
11644  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 425, __pyx_L1_error)
11645  __Pyx_GOTREF(__pyx_t_4);
11646  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11647  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11648 
11649  /* "View.MemoryView":424
11650  * if have_slices:
11651  * obj = self.is_slice(value)
11652  * if obj: # <<<<<<<<<<<<<<
11653  * self.setitem_slice_assignment(self[index], obj)
11654  * else:
11655  */
11656  goto __pyx_L5;
11657  }
11658 
11659  /* "View.MemoryView":427
11660  * self.setitem_slice_assignment(self[index], obj)
11661  * else:
11662  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
11663  * else:
11664  * self.setitem_indexed(index, value)
11665  */
11666  /*else*/ {
11667  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error)
11668  __Pyx_GOTREF(__pyx_t_4);
11669  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 427, __pyx_L1_error)
11670  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error)
11671  __Pyx_GOTREF(__pyx_t_2);
11672  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11673  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11674  }
11675  __pyx_L5:;
11676 
11677  /* "View.MemoryView":422
11678  * have_slices, index = _unellipsify(index, self.view.ndim)
11679  *
11680  * if have_slices: # <<<<<<<<<<<<<<
11681  * obj = self.is_slice(value)
11682  * if obj:
11683  */
11684  goto __pyx_L4;
11685  }
11686 
11687  /* "View.MemoryView":429
11688  * self.setitem_slice_assign_scalar(self[index], value)
11689  * else:
11690  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
11691  *
11692  * cdef is_slice(self, obj):
11693  */
11694  /*else*/ {
11695  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error)
11696  __Pyx_GOTREF(__pyx_t_2);
11697  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11698  }
11699  __pyx_L4:;
11700 
11701  /* "View.MemoryView":416
11702  * return self.convert_item_to_object(itemp)
11703  *
11704  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11705  * if self.view.readonly:
11706  * raise TypeError("Cannot assign to read-only memoryview")
11707  */
11708 
11709  /* function exit code */
11710  __pyx_r = 0;
11711  goto __pyx_L0;
11712  __pyx_L1_error:;
11713  __Pyx_XDECREF(__pyx_t_2);
11714  __Pyx_XDECREF(__pyx_t_3);
11715  __Pyx_XDECREF(__pyx_t_4);
11716  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11717  __pyx_r = -1;
11718  __pyx_L0:;
11719  __Pyx_XDECREF(__pyx_v_have_slices);
11720  __Pyx_XDECREF(__pyx_v_obj);
11721  __Pyx_XDECREF(__pyx_v_index);
11722  __Pyx_RefNannyFinishContext();
11723  return __pyx_r;
11724 }
11725 
11726 /* "View.MemoryView":431
11727  * self.setitem_indexed(index, value)
11728  *
11729  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11730  * if not isinstance(obj, memoryview):
11731  * try:
11732  */
11733 
11734 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11735  PyObject *__pyx_r = NULL;
11736  __Pyx_RefNannyDeclarations
11737  int __pyx_t_1;
11738  int __pyx_t_2;
11739  PyObject *__pyx_t_3 = NULL;
11740  PyObject *__pyx_t_4 = NULL;
11741  PyObject *__pyx_t_5 = NULL;
11742  PyObject *__pyx_t_6 = NULL;
11743  PyObject *__pyx_t_7 = NULL;
11744  PyObject *__pyx_t_8 = NULL;
11745  int __pyx_t_9;
11746  int __pyx_lineno = 0;
11747  const char *__pyx_filename = NULL;
11748  int __pyx_clineno = 0;
11749  __Pyx_RefNannySetupContext("is_slice", 0);
11750  __Pyx_INCREF(__pyx_v_obj);
11751 
11752  /* "View.MemoryView":432
11753  *
11754  * cdef is_slice(self, obj):
11755  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11756  * try:
11757  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11758  */
11759  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11760  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11761  if (__pyx_t_2) {
11762 
11763  /* "View.MemoryView":433
11764  * cdef is_slice(self, obj):
11765  * if not isinstance(obj, memoryview):
11766  * try: # <<<<<<<<<<<<<<
11767  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11768  * self.dtype_is_object)
11769  */
11770  {
11771  __Pyx_PyThreadState_declare
11772  __Pyx_PyThreadState_assign
11773  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11774  __Pyx_XGOTREF(__pyx_t_3);
11775  __Pyx_XGOTREF(__pyx_t_4);
11776  __Pyx_XGOTREF(__pyx_t_5);
11777  /*try:*/ {
11778 
11779  /* "View.MemoryView":434
11780  * if not isinstance(obj, memoryview):
11781  * try:
11782  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11783  * self.dtype_is_object)
11784  * except TypeError:
11785  */
11786  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 434, __pyx_L4_error)
11787  __Pyx_GOTREF(__pyx_t_6);
11788 
11789  /* "View.MemoryView":435
11790  * try:
11791  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11792  * self.dtype_is_object) # <<<<<<<<<<<<<<
11793  * except TypeError:
11794  * return None
11795  */
11796  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 435, __pyx_L4_error)
11797  __Pyx_GOTREF(__pyx_t_7);
11798 
11799  /* "View.MemoryView":434
11800  * if not isinstance(obj, memoryview):
11801  * try:
11802  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11803  * self.dtype_is_object)
11804  * except TypeError:
11805  */
11806  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 434, __pyx_L4_error)
11807  __Pyx_GOTREF(__pyx_t_8);
11808  __Pyx_INCREF(__pyx_v_obj);
11809  __Pyx_GIVEREF(__pyx_v_obj);
11810  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11811  __Pyx_GIVEREF(__pyx_t_6);
11812  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11813  __Pyx_GIVEREF(__pyx_t_7);
11814  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11815  __pyx_t_6 = 0;
11816  __pyx_t_7 = 0;
11817  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 434, __pyx_L4_error)
11818  __Pyx_GOTREF(__pyx_t_7);
11819  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11820  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11821  __pyx_t_7 = 0;
11822 
11823  /* "View.MemoryView":433
11824  * cdef is_slice(self, obj):
11825  * if not isinstance(obj, memoryview):
11826  * try: # <<<<<<<<<<<<<<
11827  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11828  * self.dtype_is_object)
11829  */
11830  }
11831  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11832  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11833  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11834  goto __pyx_L9_try_end;
11835  __pyx_L4_error:;
11836  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11837  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11838  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11839 
11840  /* "View.MemoryView":436
11841  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11842  * self.dtype_is_object)
11843  * except TypeError: # <<<<<<<<<<<<<<
11844  * return None
11845  *
11846  */
11847  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11848  if (__pyx_t_9) {
11849  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11850  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 436, __pyx_L6_except_error)
11851  __Pyx_GOTREF(__pyx_t_7);
11852  __Pyx_GOTREF(__pyx_t_8);
11853  __Pyx_GOTREF(__pyx_t_6);
11854 
11855  /* "View.MemoryView":437
11856  * self.dtype_is_object)
11857  * except TypeError:
11858  * return None # <<<<<<<<<<<<<<
11859  *
11860  * return obj
11861  */
11862  __Pyx_XDECREF(__pyx_r);
11863  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11864  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11865  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11866  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11867  goto __pyx_L7_except_return;
11868  }
11869  goto __pyx_L6_except_error;
11870  __pyx_L6_except_error:;
11871 
11872  /* "View.MemoryView":433
11873  * cdef is_slice(self, obj):
11874  * if not isinstance(obj, memoryview):
11875  * try: # <<<<<<<<<<<<<<
11876  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11877  * self.dtype_is_object)
11878  */
11879  __Pyx_XGIVEREF(__pyx_t_3);
11880  __Pyx_XGIVEREF(__pyx_t_4);
11881  __Pyx_XGIVEREF(__pyx_t_5);
11882  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11883  goto __pyx_L1_error;
11884  __pyx_L7_except_return:;
11885  __Pyx_XGIVEREF(__pyx_t_3);
11886  __Pyx_XGIVEREF(__pyx_t_4);
11887  __Pyx_XGIVEREF(__pyx_t_5);
11888  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11889  goto __pyx_L0;
11890  __pyx_L9_try_end:;
11891  }
11892 
11893  /* "View.MemoryView":432
11894  *
11895  * cdef is_slice(self, obj):
11896  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11897  * try:
11898  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11899  */
11900  }
11901 
11902  /* "View.MemoryView":439
11903  * return None
11904  *
11905  * return obj # <<<<<<<<<<<<<<
11906  *
11907  * cdef setitem_slice_assignment(self, dst, src):
11908  */
11909  __Pyx_XDECREF(__pyx_r);
11910  __Pyx_INCREF(__pyx_v_obj);
11911  __pyx_r = __pyx_v_obj;
11912  goto __pyx_L0;
11913 
11914  /* "View.MemoryView":431
11915  * self.setitem_indexed(index, value)
11916  *
11917  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11918  * if not isinstance(obj, memoryview):
11919  * try:
11920  */
11921 
11922  /* function exit code */
11923  __pyx_L1_error:;
11924  __Pyx_XDECREF(__pyx_t_6);
11925  __Pyx_XDECREF(__pyx_t_7);
11926  __Pyx_XDECREF(__pyx_t_8);
11927  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11928  __pyx_r = 0;
11929  __pyx_L0:;
11930  __Pyx_XDECREF(__pyx_v_obj);
11931  __Pyx_XGIVEREF(__pyx_r);
11932  __Pyx_RefNannyFinishContext();
11933  return __pyx_r;
11934 }
11935 
11936 /* "View.MemoryView":441
11937  * return obj
11938  *
11939  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11940  * cdef __Pyx_memviewslice dst_slice
11941  * cdef __Pyx_memviewslice src_slice
11942  */
11943 
11944 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11945  __Pyx_memviewslice __pyx_v_dst_slice;
11946  __Pyx_memviewslice __pyx_v_src_slice;
11947  PyObject *__pyx_r = NULL;
11948  __Pyx_RefNannyDeclarations
11949  __Pyx_memviewslice *__pyx_t_1;
11950  __Pyx_memviewslice *__pyx_t_2;
11951  PyObject *__pyx_t_3 = NULL;
11952  int __pyx_t_4;
11953  int __pyx_t_5;
11954  int __pyx_t_6;
11955  int __pyx_lineno = 0;
11956  const char *__pyx_filename = NULL;
11957  int __pyx_clineno = 0;
11958  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
11959 
11960  /* "View.MemoryView":445
11961  * cdef __Pyx_memviewslice src_slice
11962  *
11963  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11964  * get_slice_from_memview(dst, &dst_slice)[0],
11965  * src.ndim, dst.ndim, self.dtype_is_object)
11966  */
11967  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 445, __pyx_L1_error)
11968  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 445, __pyx_L1_error)
11969 
11970  /* "View.MemoryView":446
11971  *
11972  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11973  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
11974  * src.ndim, dst.ndim, self.dtype_is_object)
11975  *
11976  */
11977  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 446, __pyx_L1_error)
11978  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 446, __pyx_L1_error)
11979 
11980  /* "View.MemoryView":447
11981  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11982  * get_slice_from_memview(dst, &dst_slice)[0],
11983  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
11984  *
11985  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11986  */
11987  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
11988  __Pyx_GOTREF(__pyx_t_3);
11989  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
11990  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11991  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
11992  __Pyx_GOTREF(__pyx_t_3);
11993  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
11994  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11995 
11996  /* "View.MemoryView":445
11997  * cdef __Pyx_memviewslice src_slice
11998  *
11999  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12000  * get_slice_from_memview(dst, &dst_slice)[0],
12001  * src.ndim, dst.ndim, self.dtype_is_object)
12002  */
12003  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 445, __pyx_L1_error)
12004 
12005  /* "View.MemoryView":441
12006  * return obj
12007  *
12008  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12009  * cdef __Pyx_memviewslice dst_slice
12010  * cdef __Pyx_memviewslice src_slice
12011  */
12012 
12013  /* function exit code */
12014  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12015  goto __pyx_L0;
12016  __pyx_L1_error:;
12017  __Pyx_XDECREF(__pyx_t_3);
12018  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12019  __pyx_r = 0;
12020  __pyx_L0:;
12021  __Pyx_XGIVEREF(__pyx_r);
12022  __Pyx_RefNannyFinishContext();
12023  return __pyx_r;
12024 }
12025 
12026 /* "View.MemoryView":449
12027  * src.ndim, dst.ndim, self.dtype_is_object)
12028  *
12029  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12030  * cdef int array[128]
12031  * cdef void *tmp = NULL
12032  */
12033 
12034 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
12035  int __pyx_v_array[0x80];
12036  void *__pyx_v_tmp;
12037  void *__pyx_v_item;
12038  __Pyx_memviewslice *__pyx_v_dst_slice;
12039  __Pyx_memviewslice __pyx_v_tmp_slice;
12040  PyObject *__pyx_r = NULL;
12041  __Pyx_RefNannyDeclarations
12042  __Pyx_memviewslice *__pyx_t_1;
12043  int __pyx_t_2;
12044  PyObject *__pyx_t_3 = NULL;
12045  int __pyx_t_4;
12046  int __pyx_t_5;
12047  char const *__pyx_t_6;
12048  PyObject *__pyx_t_7 = NULL;
12049  PyObject *__pyx_t_8 = NULL;
12050  PyObject *__pyx_t_9 = NULL;
12051  PyObject *__pyx_t_10 = NULL;
12052  PyObject *__pyx_t_11 = NULL;
12053  PyObject *__pyx_t_12 = NULL;
12054  int __pyx_lineno = 0;
12055  const char *__pyx_filename = NULL;
12056  int __pyx_clineno = 0;
12057  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
12058 
12059  /* "View.MemoryView":451
12060  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12061  * cdef int array[128]
12062  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
12063  * cdef void *item
12064  *
12065  */
12066  __pyx_v_tmp = NULL;
12067 
12068  /* "View.MemoryView":456
12069  * cdef __Pyx_memviewslice *dst_slice
12070  * cdef __Pyx_memviewslice tmp_slice
12071  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
12072  *
12073  * if <size_t>self.view.itemsize > sizeof(array):
12074  */
12075  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 456, __pyx_L1_error)
12076  __pyx_v_dst_slice = __pyx_t_1;
12077 
12078  /* "View.MemoryView":458
12079  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12080  *
12081  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12082  * tmp = PyMem_Malloc(self.view.itemsize)
12083  * if tmp == NULL:
12084  */
12085  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
12086  if (__pyx_t_2) {
12087 
12088  /* "View.MemoryView":459
12089  *
12090  * if <size_t>self.view.itemsize > sizeof(array):
12091  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
12092  * if tmp == NULL:
12093  * raise MemoryError
12094  */
12095  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12096 
12097  /* "View.MemoryView":460
12098  * if <size_t>self.view.itemsize > sizeof(array):
12099  * tmp = PyMem_Malloc(self.view.itemsize)
12100  * if tmp == NULL: # <<<<<<<<<<<<<<
12101  * raise MemoryError
12102  * item = tmp
12103  */
12104  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
12105  if (unlikely(__pyx_t_2)) {
12106 
12107  /* "View.MemoryView":461
12108  * tmp = PyMem_Malloc(self.view.itemsize)
12109  * if tmp == NULL:
12110  * raise MemoryError # <<<<<<<<<<<<<<
12111  * item = tmp
12112  * else:
12113  */
12114  PyErr_NoMemory(); __PYX_ERR(2, 461, __pyx_L1_error)
12115 
12116  /* "View.MemoryView":460
12117  * if <size_t>self.view.itemsize > sizeof(array):
12118  * tmp = PyMem_Malloc(self.view.itemsize)
12119  * if tmp == NULL: # <<<<<<<<<<<<<<
12120  * raise MemoryError
12121  * item = tmp
12122  */
12123  }
12124 
12125  /* "View.MemoryView":462
12126  * if tmp == NULL:
12127  * raise MemoryError
12128  * item = tmp # <<<<<<<<<<<<<<
12129  * else:
12130  * item = <void *> array
12131  */
12132  __pyx_v_item = __pyx_v_tmp;
12133 
12134  /* "View.MemoryView":458
12135  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12136  *
12137  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12138  * tmp = PyMem_Malloc(self.view.itemsize)
12139  * if tmp == NULL:
12140  */
12141  goto __pyx_L3;
12142  }
12143 
12144  /* "View.MemoryView":464
12145  * item = tmp
12146  * else:
12147  * item = <void *> array # <<<<<<<<<<<<<<
12148  *
12149  * try:
12150  */
12151  /*else*/ {
12152  __pyx_v_item = ((void *)__pyx_v_array);
12153  }
12154  __pyx_L3:;
12155 
12156  /* "View.MemoryView":466
12157  * item = <void *> array
12158  *
12159  * try: # <<<<<<<<<<<<<<
12160  * if self.dtype_is_object:
12161  * (<PyObject **> item)[0] = <PyObject *> value
12162  */
12163  /*try:*/ {
12164 
12165  /* "View.MemoryView":467
12166  *
12167  * try:
12168  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12169  * (<PyObject **> item)[0] = <PyObject *> value
12170  * else:
12171  */
12172  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
12173  if (__pyx_t_2) {
12174 
12175  /* "View.MemoryView":468
12176  * try:
12177  * if self.dtype_is_object:
12178  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
12179  * else:
12180  * self.assign_item_from_object(<char *> item, value)
12181  */
12182  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12183 
12184  /* "View.MemoryView":467
12185  *
12186  * try:
12187  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12188  * (<PyObject **> item)[0] = <PyObject *> value
12189  * else:
12190  */
12191  goto __pyx_L8;
12192  }
12193 
12194  /* "View.MemoryView":470
12195  * (<PyObject **> item)[0] = <PyObject *> value
12196  * else:
12197  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
12198  *
12199  *
12200  */
12201  /*else*/ {
12202  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 470, __pyx_L6_error)
12203  __Pyx_GOTREF(__pyx_t_3);
12204  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12205  }
12206  __pyx_L8:;
12207 
12208  /* "View.MemoryView":474
12209  *
12210  *
12211  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12212  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12213  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12214  */
12215  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12216  if (__pyx_t_2) {
12217 
12218  /* "View.MemoryView":475
12219  *
12220  * if self.view.suboffsets != NULL:
12221  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
12222  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12223  * item, self.dtype_is_object)
12224  */
12225  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 475, __pyx_L6_error)
12226  __Pyx_GOTREF(__pyx_t_3);
12227  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12228 
12229  /* "View.MemoryView":474
12230  *
12231  *
12232  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12233  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12234  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12235  */
12236  }
12237 
12238  /* "View.MemoryView":476
12239  * if self.view.suboffsets != NULL:
12240  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12241  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
12242  * item, self.dtype_is_object)
12243  * finally:
12244  */
12245  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
12246  }
12247 
12248  /* "View.MemoryView":479
12249  * item, self.dtype_is_object)
12250  * finally:
12251  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
12252  *
12253  * cdef setitem_indexed(self, index, value):
12254  */
12255  /*finally:*/ {
12256  /*normal exit:*/{
12257  PyMem_Free(__pyx_v_tmp);
12258  goto __pyx_L7;
12259  }
12260  __pyx_L6_error:;
12261  /*exception exit:*/{
12262  __Pyx_PyThreadState_declare
12263  __Pyx_PyThreadState_assign
12264  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12265  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12266  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
12267  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
12268  __Pyx_XGOTREF(__pyx_t_7);
12269  __Pyx_XGOTREF(__pyx_t_8);
12270  __Pyx_XGOTREF(__pyx_t_9);
12271  __Pyx_XGOTREF(__pyx_t_10);
12272  __Pyx_XGOTREF(__pyx_t_11);
12273  __Pyx_XGOTREF(__pyx_t_12);
12274  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
12275  {
12276  PyMem_Free(__pyx_v_tmp);
12277  }
12278  if (PY_MAJOR_VERSION >= 3) {
12279  __Pyx_XGIVEREF(__pyx_t_10);
12280  __Pyx_XGIVEREF(__pyx_t_11);
12281  __Pyx_XGIVEREF(__pyx_t_12);
12282  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
12283  }
12284  __Pyx_XGIVEREF(__pyx_t_7);
12285  __Pyx_XGIVEREF(__pyx_t_8);
12286  __Pyx_XGIVEREF(__pyx_t_9);
12287  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
12288  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12289  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
12290  goto __pyx_L1_error;
12291  }
12292  __pyx_L7:;
12293  }
12294 
12295  /* "View.MemoryView":449
12296  * src.ndim, dst.ndim, self.dtype_is_object)
12297  *
12298  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12299  * cdef int array[128]
12300  * cdef void *tmp = NULL
12301  */
12302 
12303  /* function exit code */
12304  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12305  goto __pyx_L0;
12306  __pyx_L1_error:;
12307  __Pyx_XDECREF(__pyx_t_3);
12308  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12309  __pyx_r = 0;
12310  __pyx_L0:;
12311  __Pyx_XGIVEREF(__pyx_r);
12312  __Pyx_RefNannyFinishContext();
12313  return __pyx_r;
12314 }
12315 
12316 /* "View.MemoryView":481
12317  * PyMem_Free(tmp)
12318  *
12319  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12320  * cdef char *itemp = self.get_item_pointer(index)
12321  * self.assign_item_from_object(itemp, value)
12322  */
12323 
12324 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12325  char *__pyx_v_itemp;
12326  PyObject *__pyx_r = NULL;
12327  __Pyx_RefNannyDeclarations
12328  char *__pyx_t_1;
12329  PyObject *__pyx_t_2 = NULL;
12330  int __pyx_lineno = 0;
12331  const char *__pyx_filename = NULL;
12332  int __pyx_clineno = 0;
12333  __Pyx_RefNannySetupContext("setitem_indexed", 0);
12334 
12335  /* "View.MemoryView":482
12336  *
12337  * cdef setitem_indexed(self, index, value):
12338  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
12339  * self.assign_item_from_object(itemp, value)
12340  *
12341  */
12342  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 482, __pyx_L1_error)
12343  __pyx_v_itemp = __pyx_t_1;
12344 
12345  /* "View.MemoryView":483
12346  * cdef setitem_indexed(self, index, value):
12347  * cdef char *itemp = self.get_item_pointer(index)
12348  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
12349  *
12350  * cdef convert_item_to_object(self, char *itemp):
12351  */
12352  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 483, __pyx_L1_error)
12353  __Pyx_GOTREF(__pyx_t_2);
12354  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12355 
12356  /* "View.MemoryView":481
12357  * PyMem_Free(tmp)
12358  *
12359  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12360  * cdef char *itemp = self.get_item_pointer(index)
12361  * self.assign_item_from_object(itemp, value)
12362  */
12363 
12364  /* function exit code */
12365  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12366  goto __pyx_L0;
12367  __pyx_L1_error:;
12368  __Pyx_XDECREF(__pyx_t_2);
12369  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12370  __pyx_r = 0;
12371  __pyx_L0:;
12372  __Pyx_XGIVEREF(__pyx_r);
12373  __Pyx_RefNannyFinishContext();
12374  return __pyx_r;
12375 }
12376 
12377 /* "View.MemoryView":485
12378  * self.assign_item_from_object(itemp, value)
12379  *
12380  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12381  * """Only used if instantiated manually by the user, or if Cython doesn't
12382  * know how to convert the type"""
12383  */
12384 
12385 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
12386  PyObject *__pyx_v_struct = NULL;
12387  PyObject *__pyx_v_bytesitem = 0;
12388  PyObject *__pyx_v_result = NULL;
12389  PyObject *__pyx_r = NULL;
12390  __Pyx_RefNannyDeclarations
12391  PyObject *__pyx_t_1 = NULL;
12392  PyObject *__pyx_t_2 = NULL;
12393  PyObject *__pyx_t_3 = NULL;
12394  PyObject *__pyx_t_4 = NULL;
12395  PyObject *__pyx_t_5 = NULL;
12396  PyObject *__pyx_t_6 = NULL;
12397  PyObject *__pyx_t_7 = NULL;
12398  int __pyx_t_8;
12399  PyObject *__pyx_t_9 = NULL;
12400  size_t __pyx_t_10;
12401  int __pyx_t_11;
12402  int __pyx_lineno = 0;
12403  const char *__pyx_filename = NULL;
12404  int __pyx_clineno = 0;
12405  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
12406 
12407  /* "View.MemoryView":488
12408  * """Only used if instantiated manually by the user, or if Cython doesn't
12409  * know how to convert the type"""
12410  * import struct # <<<<<<<<<<<<<<
12411  * cdef bytes bytesitem
12412  *
12413  */
12414  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L1_error)
12415  __Pyx_GOTREF(__pyx_t_1);
12416  __pyx_v_struct = __pyx_t_1;
12417  __pyx_t_1 = 0;
12418 
12419  /* "View.MemoryView":491
12420  * cdef bytes bytesitem
12421  *
12422  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
12423  * try:
12424  * result = struct.unpack(self.view.format, bytesitem)
12425  */
12426  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 491, __pyx_L1_error)
12427  __Pyx_GOTREF(__pyx_t_1);
12428  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12429  __pyx_t_1 = 0;
12430 
12431  /* "View.MemoryView":492
12432  *
12433  * bytesitem = itemp[:self.view.itemsize]
12434  * try: # <<<<<<<<<<<<<<
12435  * result = struct.unpack(self.view.format, bytesitem)
12436  * except struct.error:
12437  */
12438  {
12439  __Pyx_PyThreadState_declare
12440  __Pyx_PyThreadState_assign
12441  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12442  __Pyx_XGOTREF(__pyx_t_2);
12443  __Pyx_XGOTREF(__pyx_t_3);
12444  __Pyx_XGOTREF(__pyx_t_4);
12445  /*try:*/ {
12446 
12447  /* "View.MemoryView":493
12448  * bytesitem = itemp[:self.view.itemsize]
12449  * try:
12450  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
12451  * except struct.error:
12452  * raise ValueError("Unable to convert item to object")
12453  */
12454  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 493, __pyx_L3_error)
12455  __Pyx_GOTREF(__pyx_t_5);
12456  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 493, __pyx_L3_error)
12457  __Pyx_GOTREF(__pyx_t_6);
12458  __pyx_t_7 = NULL;
12459  __pyx_t_8 = 0;
12460  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12461  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12462  if (likely(__pyx_t_7)) {
12463  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
12464  __Pyx_INCREF(__pyx_t_7);
12465  __Pyx_INCREF(function);
12466  __Pyx_DECREF_SET(__pyx_t_5, function);
12467  __pyx_t_8 = 1;
12468  }
12469  }
12470  #if CYTHON_FAST_PYCALL
12471  if (PyFunction_Check(__pyx_t_5)) {
12472  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12473  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
12474  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12475  __Pyx_GOTREF(__pyx_t_1);
12476  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12477  } else
12478  #endif
12479  #if CYTHON_FAST_PYCCALL
12480  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12481  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12482  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
12483  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12484  __Pyx_GOTREF(__pyx_t_1);
12485  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12486  } else
12487  #endif
12488  {
12489  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 493, __pyx_L3_error)
12490  __Pyx_GOTREF(__pyx_t_9);
12491  if (__pyx_t_7) {
12492  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12493  }
12494  __Pyx_GIVEREF(__pyx_t_6);
12495  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12496  __Pyx_INCREF(__pyx_v_bytesitem);
12497  __Pyx_GIVEREF(__pyx_v_bytesitem);
12498  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12499  __pyx_t_6 = 0;
12500  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
12501  __Pyx_GOTREF(__pyx_t_1);
12502  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12503  }
12504  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12505  __pyx_v_result = __pyx_t_1;
12506  __pyx_t_1 = 0;
12507 
12508  /* "View.MemoryView":492
12509  *
12510  * bytesitem = itemp[:self.view.itemsize]
12511  * try: # <<<<<<<<<<<<<<
12512  * result = struct.unpack(self.view.format, bytesitem)
12513  * except struct.error:
12514  */
12515  }
12516 
12517  /* "View.MemoryView":497
12518  * raise ValueError("Unable to convert item to object")
12519  * else:
12520  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12521  * return result[0]
12522  * return result
12523  */
12524  /*else:*/ {
12525  __pyx_t_10 = strlen(__pyx_v_self->view.format);
12526  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12527  if (__pyx_t_11) {
12528 
12529  /* "View.MemoryView":498
12530  * else:
12531  * if len(self.view.format) == 1:
12532  * return result[0] # <<<<<<<<<<<<<<
12533  * return result
12534  *
12535  */
12536  __Pyx_XDECREF(__pyx_r);
12537  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 498, __pyx_L5_except_error)
12538  __Pyx_GOTREF(__pyx_t_1);
12539  __pyx_r = __pyx_t_1;
12540  __pyx_t_1 = 0;
12541  goto __pyx_L6_except_return;
12542 
12543  /* "View.MemoryView":497
12544  * raise ValueError("Unable to convert item to object")
12545  * else:
12546  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12547  * return result[0]
12548  * return result
12549  */
12550  }
12551 
12552  /* "View.MemoryView":499
12553  * if len(self.view.format) == 1:
12554  * return result[0]
12555  * return result # <<<<<<<<<<<<<<
12556  *
12557  * cdef assign_item_from_object(self, char *itemp, object value):
12558  */
12559  __Pyx_XDECREF(__pyx_r);
12560  __Pyx_INCREF(__pyx_v_result);
12561  __pyx_r = __pyx_v_result;
12562  goto __pyx_L6_except_return;
12563  }
12564  __pyx_L3_error:;
12565  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12566  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12567  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12568  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12569  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12570 
12571  /* "View.MemoryView":494
12572  * try:
12573  * result = struct.unpack(self.view.format, bytesitem)
12574  * except struct.error: # <<<<<<<<<<<<<<
12575  * raise ValueError("Unable to convert item to object")
12576  * else:
12577  */
12578  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12579  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 494, __pyx_L5_except_error)
12580  __Pyx_GOTREF(__pyx_t_6);
12581  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12582  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12583  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12584  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12585  if (__pyx_t_8) {
12586  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12587  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 494, __pyx_L5_except_error)
12588  __Pyx_GOTREF(__pyx_t_9);
12589  __Pyx_GOTREF(__pyx_t_5);
12590  __Pyx_GOTREF(__pyx_t_1);
12591 
12592  /* "View.MemoryView":495
12593  * result = struct.unpack(self.view.format, bytesitem)
12594  * except struct.error:
12595  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
12596  * else:
12597  * if len(self.view.format) == 1:
12598  */
12599  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L5_except_error)
12600  __Pyx_GOTREF(__pyx_t_6);
12601  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12602  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12603  __PYX_ERR(2, 495, __pyx_L5_except_error)
12604  }
12605  goto __pyx_L5_except_error;
12606  __pyx_L5_except_error:;
12607 
12608  /* "View.MemoryView":492
12609  *
12610  * bytesitem = itemp[:self.view.itemsize]
12611  * try: # <<<<<<<<<<<<<<
12612  * result = struct.unpack(self.view.format, bytesitem)
12613  * except struct.error:
12614  */
12615  __Pyx_XGIVEREF(__pyx_t_2);
12616  __Pyx_XGIVEREF(__pyx_t_3);
12617  __Pyx_XGIVEREF(__pyx_t_4);
12618  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12619  goto __pyx_L1_error;
12620  __pyx_L6_except_return:;
12621  __Pyx_XGIVEREF(__pyx_t_2);
12622  __Pyx_XGIVEREF(__pyx_t_3);
12623  __Pyx_XGIVEREF(__pyx_t_4);
12624  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12625  goto __pyx_L0;
12626  }
12627 
12628  /* "View.MemoryView":485
12629  * self.assign_item_from_object(itemp, value)
12630  *
12631  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12632  * """Only used if instantiated manually by the user, or if Cython doesn't
12633  * know how to convert the type"""
12634  */
12635 
12636  /* function exit code */
12637  __pyx_L1_error:;
12638  __Pyx_XDECREF(__pyx_t_1);
12639  __Pyx_XDECREF(__pyx_t_5);
12640  __Pyx_XDECREF(__pyx_t_6);
12641  __Pyx_XDECREF(__pyx_t_7);
12642  __Pyx_XDECREF(__pyx_t_9);
12643  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12644  __pyx_r = 0;
12645  __pyx_L0:;
12646  __Pyx_XDECREF(__pyx_v_struct);
12647  __Pyx_XDECREF(__pyx_v_bytesitem);
12648  __Pyx_XDECREF(__pyx_v_result);
12649  __Pyx_XGIVEREF(__pyx_r);
12650  __Pyx_RefNannyFinishContext();
12651  return __pyx_r;
12652 }
12653 
12654 /* "View.MemoryView":501
12655  * return result
12656  *
12657  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12658  * """Only used if instantiated manually by the user, or if Cython doesn't
12659  * know how to convert the type"""
12660  */
12661 
12662 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12663  PyObject *__pyx_v_struct = NULL;
12664  char __pyx_v_c;
12665  PyObject *__pyx_v_bytesvalue = 0;
12666  Py_ssize_t __pyx_v_i;
12667  PyObject *__pyx_r = NULL;
12668  __Pyx_RefNannyDeclarations
12669  PyObject *__pyx_t_1 = NULL;
12670  int __pyx_t_2;
12671  int __pyx_t_3;
12672  PyObject *__pyx_t_4 = NULL;
12673  PyObject *__pyx_t_5 = NULL;
12674  PyObject *__pyx_t_6 = NULL;
12675  int __pyx_t_7;
12676  PyObject *__pyx_t_8 = NULL;
12677  Py_ssize_t __pyx_t_9;
12678  PyObject *__pyx_t_10 = NULL;
12679  char *__pyx_t_11;
12680  char *__pyx_t_12;
12681  char *__pyx_t_13;
12682  char *__pyx_t_14;
12683  int __pyx_lineno = 0;
12684  const char *__pyx_filename = NULL;
12685  int __pyx_clineno = 0;
12686  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
12687 
12688  /* "View.MemoryView":504
12689  * """Only used if instantiated manually by the user, or if Cython doesn't
12690  * know how to convert the type"""
12691  * import struct # <<<<<<<<<<<<<<
12692  * cdef char c
12693  * cdef bytes bytesvalue
12694  */
12695  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 504, __pyx_L1_error)
12696  __Pyx_GOTREF(__pyx_t_1);
12697  __pyx_v_struct = __pyx_t_1;
12698  __pyx_t_1 = 0;
12699 
12700  /* "View.MemoryView":509
12701  * cdef Py_ssize_t i
12702  *
12703  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12704  * bytesvalue = struct.pack(self.view.format, *value)
12705  * else:
12706  */
12707  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12708  __pyx_t_3 = (__pyx_t_2 != 0);
12709  if (__pyx_t_3) {
12710 
12711  /* "View.MemoryView":510
12712  *
12713  * if isinstance(value, tuple):
12714  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
12715  * else:
12716  * bytesvalue = struct.pack(self.view.format, value)
12717  */
12718  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 510, __pyx_L1_error)
12719  __Pyx_GOTREF(__pyx_t_1);
12720  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
12721  __Pyx_GOTREF(__pyx_t_4);
12722  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 510, __pyx_L1_error)
12723  __Pyx_GOTREF(__pyx_t_5);
12724  __Pyx_GIVEREF(__pyx_t_4);
12725  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12726  __pyx_t_4 = 0;
12727  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
12728  __Pyx_GOTREF(__pyx_t_4);
12729  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 510, __pyx_L1_error)
12730  __Pyx_GOTREF(__pyx_t_6);
12731  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12732  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12733  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
12734  __Pyx_GOTREF(__pyx_t_4);
12735  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12736  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12737  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 510, __pyx_L1_error)
12738  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12739  __pyx_t_4 = 0;
12740 
12741  /* "View.MemoryView":509
12742  * cdef Py_ssize_t i
12743  *
12744  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12745  * bytesvalue = struct.pack(self.view.format, *value)
12746  * else:
12747  */
12748  goto __pyx_L3;
12749  }
12750 
12751  /* "View.MemoryView":512
12752  * bytesvalue = struct.pack(self.view.format, *value)
12753  * else:
12754  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
12755  *
12756  * for i, c in enumerate(bytesvalue):
12757  */
12758  /*else*/ {
12759  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error)
12760  __Pyx_GOTREF(__pyx_t_6);
12761  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error)
12762  __Pyx_GOTREF(__pyx_t_1);
12763  __pyx_t_5 = NULL;
12764  __pyx_t_7 = 0;
12765  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12766  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12767  if (likely(__pyx_t_5)) {
12768  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12769  __Pyx_INCREF(__pyx_t_5);
12770  __Pyx_INCREF(function);
12771  __Pyx_DECREF_SET(__pyx_t_6, function);
12772  __pyx_t_7 = 1;
12773  }
12774  }
12775  #if CYTHON_FAST_PYCALL
12776  if (PyFunction_Check(__pyx_t_6)) {
12777  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12778  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
12779  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12780  __Pyx_GOTREF(__pyx_t_4);
12781  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12782  } else
12783  #endif
12784  #if CYTHON_FAST_PYCCALL
12785  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12786  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12787  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
12788  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12789  __Pyx_GOTREF(__pyx_t_4);
12790  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12791  } else
12792  #endif
12793  {
12794  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 512, __pyx_L1_error)
12795  __Pyx_GOTREF(__pyx_t_8);
12796  if (__pyx_t_5) {
12797  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12798  }
12799  __Pyx_GIVEREF(__pyx_t_1);
12800  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12801  __Pyx_INCREF(__pyx_v_value);
12802  __Pyx_GIVEREF(__pyx_v_value);
12803  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12804  __pyx_t_1 = 0;
12805  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
12806  __Pyx_GOTREF(__pyx_t_4);
12807  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12808  }
12809  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12810  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error)
12811  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12812  __pyx_t_4 = 0;
12813  }
12814  __pyx_L3:;
12815 
12816  /* "View.MemoryView":514
12817  * bytesvalue = struct.pack(self.view.format, value)
12818  *
12819  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12820  * itemp[i] = c
12821  *
12822  */
12823  __pyx_t_9 = 0;
12824  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12825  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
12826  __PYX_ERR(2, 514, __pyx_L1_error)
12827  }
12828  __Pyx_INCREF(__pyx_v_bytesvalue);
12829  __pyx_t_10 = __pyx_v_bytesvalue;
12830  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12831  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12832  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12833  __pyx_t_11 = __pyx_t_14;
12834  __pyx_v_c = (__pyx_t_11[0]);
12835 
12836  /* "View.MemoryView":515
12837  *
12838  * for i, c in enumerate(bytesvalue):
12839  * itemp[i] = c # <<<<<<<<<<<<<<
12840  *
12841  * @cname('getbuffer')
12842  */
12843  __pyx_v_i = __pyx_t_9;
12844 
12845  /* "View.MemoryView":514
12846  * bytesvalue = struct.pack(self.view.format, value)
12847  *
12848  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12849  * itemp[i] = c
12850  *
12851  */
12852  __pyx_t_9 = (__pyx_t_9 + 1);
12853 
12854  /* "View.MemoryView":515
12855  *
12856  * for i, c in enumerate(bytesvalue):
12857  * itemp[i] = c # <<<<<<<<<<<<<<
12858  *
12859  * @cname('getbuffer')
12860  */
12861  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12862  }
12863  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12864 
12865  /* "View.MemoryView":501
12866  * return result
12867  *
12868  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12869  * """Only used if instantiated manually by the user, or if Cython doesn't
12870  * know how to convert the type"""
12871  */
12872 
12873  /* function exit code */
12874  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12875  goto __pyx_L0;
12876  __pyx_L1_error:;
12877  __Pyx_XDECREF(__pyx_t_1);
12878  __Pyx_XDECREF(__pyx_t_4);
12879  __Pyx_XDECREF(__pyx_t_5);
12880  __Pyx_XDECREF(__pyx_t_6);
12881  __Pyx_XDECREF(__pyx_t_8);
12882  __Pyx_XDECREF(__pyx_t_10);
12883  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12884  __pyx_r = 0;
12885  __pyx_L0:;
12886  __Pyx_XDECREF(__pyx_v_struct);
12887  __Pyx_XDECREF(__pyx_v_bytesvalue);
12888  __Pyx_XGIVEREF(__pyx_r);
12889  __Pyx_RefNannyFinishContext();
12890  return __pyx_r;
12891 }
12892 
12893 /* "View.MemoryView":518
12894  *
12895  * @cname('getbuffer')
12896  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12897  * if flags & PyBUF_WRITABLE and self.view.readonly:
12898  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12899  */
12900 
12901 /* Python wrapper */
12902 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
12903 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12904  int __pyx_r;
12905  __Pyx_RefNannyDeclarations
12906  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
12907  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
12908 
12909  /* function exit code */
12910  __Pyx_RefNannyFinishContext();
12911  return __pyx_r;
12912 }
12913 
12914 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12915  int __pyx_r;
12916  __Pyx_RefNannyDeclarations
12917  int __pyx_t_1;
12918  int __pyx_t_2;
12919  PyObject *__pyx_t_3 = NULL;
12920  Py_ssize_t *__pyx_t_4;
12921  char *__pyx_t_5;
12922  void *__pyx_t_6;
12923  int __pyx_t_7;
12924  Py_ssize_t __pyx_t_8;
12925  int __pyx_lineno = 0;
12926  const char *__pyx_filename = NULL;
12927  int __pyx_clineno = 0;
12928  if (__pyx_v_info == NULL) {
12929  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
12930  return -1;
12931  }
12932  __Pyx_RefNannySetupContext("__getbuffer__", 0);
12933  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12934  __Pyx_GIVEREF(__pyx_v_info->obj);
12935 
12936  /* "View.MemoryView":519
12937  * @cname('getbuffer')
12938  * def __getbuffer__(self, Py_buffer *info, int flags):
12939  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12940  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12941  *
12942  */
12943  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12944  if (__pyx_t_2) {
12945  } else {
12946  __pyx_t_1 = __pyx_t_2;
12947  goto __pyx_L4_bool_binop_done;
12948  }
12949  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12950  __pyx_t_1 = __pyx_t_2;
12951  __pyx_L4_bool_binop_done:;
12952  if (unlikely(__pyx_t_1)) {
12953 
12954  /* "View.MemoryView":520
12955  * def __getbuffer__(self, Py_buffer *info, int flags):
12956  * if flags & PyBUF_WRITABLE and self.view.readonly:
12957  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
12958  *
12959  * if flags & PyBUF_ND:
12960  */
12961  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 520, __pyx_L1_error)
12962  __Pyx_GOTREF(__pyx_t_3);
12963  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12964  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12965  __PYX_ERR(2, 520, __pyx_L1_error)
12966 
12967  /* "View.MemoryView":519
12968  * @cname('getbuffer')
12969  * def __getbuffer__(self, Py_buffer *info, int flags):
12970  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12971  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12972  *
12973  */
12974  }
12975 
12976  /* "View.MemoryView":522
12977  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12978  *
12979  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
12980  * info.shape = self.view.shape
12981  * else:
12982  */
12983  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
12984  if (__pyx_t_1) {
12985 
12986  /* "View.MemoryView":523
12987  *
12988  * if flags & PyBUF_ND:
12989  * info.shape = self.view.shape # <<<<<<<<<<<<<<
12990  * else:
12991  * info.shape = NULL
12992  */
12993  __pyx_t_4 = __pyx_v_self->view.shape;
12994  __pyx_v_info->shape = __pyx_t_4;
12995 
12996  /* "View.MemoryView":522
12997  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12998  *
12999  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13000  * info.shape = self.view.shape
13001  * else:
13002  */
13003  goto __pyx_L6;
13004  }
13005 
13006  /* "View.MemoryView":525
13007  * info.shape = self.view.shape
13008  * else:
13009  * info.shape = NULL # <<<<<<<<<<<<<<
13010  *
13011  * if flags & PyBUF_STRIDES:
13012  */
13013  /*else*/ {
13014  __pyx_v_info->shape = NULL;
13015  }
13016  __pyx_L6:;
13017 
13018  /* "View.MemoryView":527
13019  * info.shape = NULL
13020  *
13021  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13022  * info.strides = self.view.strides
13023  * else:
13024  */
13025  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13026  if (__pyx_t_1) {
13027 
13028  /* "View.MemoryView":528
13029  *
13030  * if flags & PyBUF_STRIDES:
13031  * info.strides = self.view.strides # <<<<<<<<<<<<<<
13032  * else:
13033  * info.strides = NULL
13034  */
13035  __pyx_t_4 = __pyx_v_self->view.strides;
13036  __pyx_v_info->strides = __pyx_t_4;
13037 
13038  /* "View.MemoryView":527
13039  * info.shape = NULL
13040  *
13041  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13042  * info.strides = self.view.strides
13043  * else:
13044  */
13045  goto __pyx_L7;
13046  }
13047 
13048  /* "View.MemoryView":530
13049  * info.strides = self.view.strides
13050  * else:
13051  * info.strides = NULL # <<<<<<<<<<<<<<
13052  *
13053  * if flags & PyBUF_INDIRECT:
13054  */
13055  /*else*/ {
13056  __pyx_v_info->strides = NULL;
13057  }
13058  __pyx_L7:;
13059 
13060  /* "View.MemoryView":532
13061  * info.strides = NULL
13062  *
13063  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13064  * info.suboffsets = self.view.suboffsets
13065  * else:
13066  */
13067  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13068  if (__pyx_t_1) {
13069 
13070  /* "View.MemoryView":533
13071  *
13072  * if flags & PyBUF_INDIRECT:
13073  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
13074  * else:
13075  * info.suboffsets = NULL
13076  */
13077  __pyx_t_4 = __pyx_v_self->view.suboffsets;
13078  __pyx_v_info->suboffsets = __pyx_t_4;
13079 
13080  /* "View.MemoryView":532
13081  * info.strides = NULL
13082  *
13083  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13084  * info.suboffsets = self.view.suboffsets
13085  * else:
13086  */
13087  goto __pyx_L8;
13088  }
13089 
13090  /* "View.MemoryView":535
13091  * info.suboffsets = self.view.suboffsets
13092  * else:
13093  * info.suboffsets = NULL # <<<<<<<<<<<<<<
13094  *
13095  * if flags & PyBUF_FORMAT:
13096  */
13097  /*else*/ {
13098  __pyx_v_info->suboffsets = NULL;
13099  }
13100  __pyx_L8:;
13101 
13102  /* "View.MemoryView":537
13103  * info.suboffsets = NULL
13104  *
13105  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13106  * info.format = self.view.format
13107  * else:
13108  */
13109  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13110  if (__pyx_t_1) {
13111 
13112  /* "View.MemoryView":538
13113  *
13114  * if flags & PyBUF_FORMAT:
13115  * info.format = self.view.format # <<<<<<<<<<<<<<
13116  * else:
13117  * info.format = NULL
13118  */
13119  __pyx_t_5 = __pyx_v_self->view.format;
13120  __pyx_v_info->format = __pyx_t_5;
13121 
13122  /* "View.MemoryView":537
13123  * info.suboffsets = NULL
13124  *
13125  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13126  * info.format = self.view.format
13127  * else:
13128  */
13129  goto __pyx_L9;
13130  }
13131 
13132  /* "View.MemoryView":540
13133  * info.format = self.view.format
13134  * else:
13135  * info.format = NULL # <<<<<<<<<<<<<<
13136  *
13137  * info.buf = self.view.buf
13138  */
13139  /*else*/ {
13140  __pyx_v_info->format = NULL;
13141  }
13142  __pyx_L9:;
13143 
13144  /* "View.MemoryView":542
13145  * info.format = NULL
13146  *
13147  * info.buf = self.view.buf # <<<<<<<<<<<<<<
13148  * info.ndim = self.view.ndim
13149  * info.itemsize = self.view.itemsize
13150  */
13151  __pyx_t_6 = __pyx_v_self->view.buf;
13152  __pyx_v_info->buf = __pyx_t_6;
13153 
13154  /* "View.MemoryView":543
13155  *
13156  * info.buf = self.view.buf
13157  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
13158  * info.itemsize = self.view.itemsize
13159  * info.len = self.view.len
13160  */
13161  __pyx_t_7 = __pyx_v_self->view.ndim;
13162  __pyx_v_info->ndim = __pyx_t_7;
13163 
13164  /* "View.MemoryView":544
13165  * info.buf = self.view.buf
13166  * info.ndim = self.view.ndim
13167  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
13168  * info.len = self.view.len
13169  * info.readonly = self.view.readonly
13170  */
13171  __pyx_t_8 = __pyx_v_self->view.itemsize;
13172  __pyx_v_info->itemsize = __pyx_t_8;
13173 
13174  /* "View.MemoryView":545
13175  * info.ndim = self.view.ndim
13176  * info.itemsize = self.view.itemsize
13177  * info.len = self.view.len # <<<<<<<<<<<<<<
13178  * info.readonly = self.view.readonly
13179  * info.obj = self
13180  */
13181  __pyx_t_8 = __pyx_v_self->view.len;
13182  __pyx_v_info->len = __pyx_t_8;
13183 
13184  /* "View.MemoryView":546
13185  * info.itemsize = self.view.itemsize
13186  * info.len = self.view.len
13187  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
13188  * info.obj = self
13189  *
13190  */
13191  __pyx_t_1 = __pyx_v_self->view.readonly;
13192  __pyx_v_info->readonly = __pyx_t_1;
13193 
13194  /* "View.MemoryView":547
13195  * info.len = self.view.len
13196  * info.readonly = self.view.readonly
13197  * info.obj = self # <<<<<<<<<<<<<<
13198  *
13199  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
13200  */
13201  __Pyx_INCREF(((PyObject *)__pyx_v_self));
13202  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13203  __Pyx_GOTREF(__pyx_v_info->obj);
13204  __Pyx_DECREF(__pyx_v_info->obj);
13205  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13206 
13207  /* "View.MemoryView":518
13208  *
13209  * @cname('getbuffer')
13210  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13211  * if flags & PyBUF_WRITABLE and self.view.readonly:
13212  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13213  */
13214 
13215  /* function exit code */
13216  __pyx_r = 0;
13217  goto __pyx_L0;
13218  __pyx_L1_error:;
13219  __Pyx_XDECREF(__pyx_t_3);
13220  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13221  __pyx_r = -1;
13222  if (__pyx_v_info->obj != NULL) {
13223  __Pyx_GOTREF(__pyx_v_info->obj);
13224  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13225  }
13226  goto __pyx_L2;
13227  __pyx_L0:;
13228  if (__pyx_v_info->obj == Py_None) {
13229  __Pyx_GOTREF(__pyx_v_info->obj);
13230  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13231  }
13232  __pyx_L2:;
13233  __Pyx_RefNannyFinishContext();
13234  return __pyx_r;
13235 }
13236 
13237 /* "View.MemoryView":553
13238  *
13239  * @property
13240  * def T(self): # <<<<<<<<<<<<<<
13241  * cdef _memoryviewslice result = memoryview_copy(self)
13242  * transpose_memslice(&result.from_slice)
13243  */
13244 
13245 /* Python wrapper */
13246 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
13247 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13248  PyObject *__pyx_r = 0;
13249  __Pyx_RefNannyDeclarations
13250  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13251  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13252 
13253  /* function exit code */
13254  __Pyx_RefNannyFinishContext();
13255  return __pyx_r;
13256 }
13257 
13258 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13259  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13260  PyObject *__pyx_r = NULL;
13261  __Pyx_RefNannyDeclarations
13262  PyObject *__pyx_t_1 = NULL;
13263  int __pyx_t_2;
13264  int __pyx_lineno = 0;
13265  const char *__pyx_filename = NULL;
13266  int __pyx_clineno = 0;
13267  __Pyx_RefNannySetupContext("__get__", 0);
13268 
13269  /* "View.MemoryView":554
13270  * @property
13271  * def T(self):
13272  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
13273  * transpose_memslice(&result.from_slice)
13274  * return result
13275  */
13276  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 554, __pyx_L1_error)
13277  __Pyx_GOTREF(__pyx_t_1);
13278  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 554, __pyx_L1_error)
13279  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13280  __pyx_t_1 = 0;
13281 
13282  /* "View.MemoryView":555
13283  * def T(self):
13284  * cdef _memoryviewslice result = memoryview_copy(self)
13285  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
13286  * return result
13287  *
13288  */
13289  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 555, __pyx_L1_error)
13290 
13291  /* "View.MemoryView":556
13292  * cdef _memoryviewslice result = memoryview_copy(self)
13293  * transpose_memslice(&result.from_slice)
13294  * return result # <<<<<<<<<<<<<<
13295  *
13296  * @property
13297  */
13298  __Pyx_XDECREF(__pyx_r);
13299  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13300  __pyx_r = ((PyObject *)__pyx_v_result);
13301  goto __pyx_L0;
13302 
13303  /* "View.MemoryView":553
13304  *
13305  * @property
13306  * def T(self): # <<<<<<<<<<<<<<
13307  * cdef _memoryviewslice result = memoryview_copy(self)
13308  * transpose_memslice(&result.from_slice)
13309  */
13310 
13311  /* function exit code */
13312  __pyx_L1_error:;
13313  __Pyx_XDECREF(__pyx_t_1);
13314  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13315  __pyx_r = NULL;
13316  __pyx_L0:;
13317  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13318  __Pyx_XGIVEREF(__pyx_r);
13319  __Pyx_RefNannyFinishContext();
13320  return __pyx_r;
13321 }
13322 
13323 /* "View.MemoryView":559
13324  *
13325  * @property
13326  * def base(self): # <<<<<<<<<<<<<<
13327  * return self.obj
13328  *
13329  */
13330 
13331 /* Python wrapper */
13332 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
13333 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13334  PyObject *__pyx_r = 0;
13335  __Pyx_RefNannyDeclarations
13336  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13337  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13338 
13339  /* function exit code */
13340  __Pyx_RefNannyFinishContext();
13341  return __pyx_r;
13342 }
13343 
13344 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13345  PyObject *__pyx_r = NULL;
13346  __Pyx_RefNannyDeclarations
13347  __Pyx_RefNannySetupContext("__get__", 0);
13348 
13349  /* "View.MemoryView":560
13350  * @property
13351  * def base(self):
13352  * return self.obj # <<<<<<<<<<<<<<
13353  *
13354  * @property
13355  */
13356  __Pyx_XDECREF(__pyx_r);
13357  __Pyx_INCREF(__pyx_v_self->obj);
13358  __pyx_r = __pyx_v_self->obj;
13359  goto __pyx_L0;
13360 
13361  /* "View.MemoryView":559
13362  *
13363  * @property
13364  * def base(self): # <<<<<<<<<<<<<<
13365  * return self.obj
13366  *
13367  */
13368 
13369  /* function exit code */
13370  __pyx_L0:;
13371  __Pyx_XGIVEREF(__pyx_r);
13372  __Pyx_RefNannyFinishContext();
13373  return __pyx_r;
13374 }
13375 
13376 /* "View.MemoryView":563
13377  *
13378  * @property
13379  * def shape(self): # <<<<<<<<<<<<<<
13380  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13381  *
13382  */
13383 
13384 /* Python wrapper */
13385 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
13386 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13387  PyObject *__pyx_r = 0;
13388  __Pyx_RefNannyDeclarations
13389  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13390  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13391 
13392  /* function exit code */
13393  __Pyx_RefNannyFinishContext();
13394  return __pyx_r;
13395 }
13396 
13397 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13398  Py_ssize_t __pyx_v_length;
13399  PyObject *__pyx_r = NULL;
13400  __Pyx_RefNannyDeclarations
13401  PyObject *__pyx_t_1 = NULL;
13402  Py_ssize_t *__pyx_t_2;
13403  Py_ssize_t *__pyx_t_3;
13404  Py_ssize_t *__pyx_t_4;
13405  PyObject *__pyx_t_5 = NULL;
13406  int __pyx_lineno = 0;
13407  const char *__pyx_filename = NULL;
13408  int __pyx_clineno = 0;
13409  __Pyx_RefNannySetupContext("__get__", 0);
13410 
13411  /* "View.MemoryView":564
13412  * @property
13413  * def shape(self):
13414  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
13415  *
13416  * @property
13417  */
13418  __Pyx_XDECREF(__pyx_r);
13419  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 564, __pyx_L1_error)
13420  __Pyx_GOTREF(__pyx_t_1);
13421  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13422  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13423  __pyx_t_2 = __pyx_t_4;
13424  __pyx_v_length = (__pyx_t_2[0]);
13425  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
13426  __Pyx_GOTREF(__pyx_t_5);
13427  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 564, __pyx_L1_error)
13428  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13429  }
13430  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
13431  __Pyx_GOTREF(__pyx_t_5);
13432  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13433  __pyx_r = __pyx_t_5;
13434  __pyx_t_5 = 0;
13435  goto __pyx_L0;
13436 
13437  /* "View.MemoryView":563
13438  *
13439  * @property
13440  * def shape(self): # <<<<<<<<<<<<<<
13441  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13442  *
13443  */
13444 
13445  /* function exit code */
13446  __pyx_L1_error:;
13447  __Pyx_XDECREF(__pyx_t_1);
13448  __Pyx_XDECREF(__pyx_t_5);
13449  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13450  __pyx_r = NULL;
13451  __pyx_L0:;
13452  __Pyx_XGIVEREF(__pyx_r);
13453  __Pyx_RefNannyFinishContext();
13454  return __pyx_r;
13455 }
13456 
13457 /* "View.MemoryView":567
13458  *
13459  * @property
13460  * def strides(self): # <<<<<<<<<<<<<<
13461  * if self.view.strides == NULL:
13462  *
13463  */
13464 
13465 /* Python wrapper */
13466 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
13467 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13468  PyObject *__pyx_r = 0;
13469  __Pyx_RefNannyDeclarations
13470  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13471  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13472 
13473  /* function exit code */
13474  __Pyx_RefNannyFinishContext();
13475  return __pyx_r;
13476 }
13477 
13478 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13479  Py_ssize_t __pyx_v_stride;
13480  PyObject *__pyx_r = NULL;
13481  __Pyx_RefNannyDeclarations
13482  int __pyx_t_1;
13483  PyObject *__pyx_t_2 = NULL;
13484  Py_ssize_t *__pyx_t_3;
13485  Py_ssize_t *__pyx_t_4;
13486  Py_ssize_t *__pyx_t_5;
13487  PyObject *__pyx_t_6 = NULL;
13488  int __pyx_lineno = 0;
13489  const char *__pyx_filename = NULL;
13490  int __pyx_clineno = 0;
13491  __Pyx_RefNannySetupContext("__get__", 0);
13492 
13493  /* "View.MemoryView":568
13494  * @property
13495  * def strides(self):
13496  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13497  *
13498  * raise ValueError("Buffer view does not expose strides")
13499  */
13500  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13501  if (unlikely(__pyx_t_1)) {
13502 
13503  /* "View.MemoryView":570
13504  * if self.view.strides == NULL:
13505  *
13506  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
13507  *
13508  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
13509  */
13510  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 570, __pyx_L1_error)
13511  __Pyx_GOTREF(__pyx_t_2);
13512  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13513  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13514  __PYX_ERR(2, 570, __pyx_L1_error)
13515 
13516  /* "View.MemoryView":568
13517  * @property
13518  * def strides(self):
13519  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13520  *
13521  * raise ValueError("Buffer view does not expose strides")
13522  */
13523  }
13524 
13525  /* "View.MemoryView":572
13526  * raise ValueError("Buffer view does not expose strides")
13527  *
13528  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
13529  *
13530  * @property
13531  */
13532  __Pyx_XDECREF(__pyx_r);
13533  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error)
13534  __Pyx_GOTREF(__pyx_t_2);
13535  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13536  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13537  __pyx_t_3 = __pyx_t_5;
13538  __pyx_v_stride = (__pyx_t_3[0]);
13539  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
13540  __Pyx_GOTREF(__pyx_t_6);
13541  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 572, __pyx_L1_error)
13542  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13543  }
13544  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
13545  __Pyx_GOTREF(__pyx_t_6);
13546  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13547  __pyx_r = __pyx_t_6;
13548  __pyx_t_6 = 0;
13549  goto __pyx_L0;
13550 
13551  /* "View.MemoryView":567
13552  *
13553  * @property
13554  * def strides(self): # <<<<<<<<<<<<<<
13555  * if self.view.strides == NULL:
13556  *
13557  */
13558 
13559  /* function exit code */
13560  __pyx_L1_error:;
13561  __Pyx_XDECREF(__pyx_t_2);
13562  __Pyx_XDECREF(__pyx_t_6);
13563  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13564  __pyx_r = NULL;
13565  __pyx_L0:;
13566  __Pyx_XGIVEREF(__pyx_r);
13567  __Pyx_RefNannyFinishContext();
13568  return __pyx_r;
13569 }
13570 
13571 /* "View.MemoryView":575
13572  *
13573  * @property
13574  * def suboffsets(self): # <<<<<<<<<<<<<<
13575  * if self.view.suboffsets == NULL:
13576  * return (-1,) * self.view.ndim
13577  */
13578 
13579 /* Python wrapper */
13580 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
13581 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13582  PyObject *__pyx_r = 0;
13583  __Pyx_RefNannyDeclarations
13584  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13585  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13586 
13587  /* function exit code */
13588  __Pyx_RefNannyFinishContext();
13589  return __pyx_r;
13590 }
13591 
13592 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13593  Py_ssize_t __pyx_v_suboffset;
13594  PyObject *__pyx_r = NULL;
13595  __Pyx_RefNannyDeclarations
13596  int __pyx_t_1;
13597  PyObject *__pyx_t_2 = NULL;
13598  PyObject *__pyx_t_3 = NULL;
13599  Py_ssize_t *__pyx_t_4;
13600  Py_ssize_t *__pyx_t_5;
13601  Py_ssize_t *__pyx_t_6;
13602  int __pyx_lineno = 0;
13603  const char *__pyx_filename = NULL;
13604  int __pyx_clineno = 0;
13605  __Pyx_RefNannySetupContext("__get__", 0);
13606 
13607  /* "View.MemoryView":576
13608  * @property
13609  * def suboffsets(self):
13610  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13611  * return (-1,) * self.view.ndim
13612  *
13613  */
13614  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13615  if (__pyx_t_1) {
13616 
13617  /* "View.MemoryView":577
13618  * def suboffsets(self):
13619  * if self.view.suboffsets == NULL:
13620  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
13621  *
13622  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
13623  */
13624  __Pyx_XDECREF(__pyx_r);
13625  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error)
13626  __Pyx_GOTREF(__pyx_t_2);
13627  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__17, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error)
13628  __Pyx_GOTREF(__pyx_t_3);
13629  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13630  __pyx_r = __pyx_t_3;
13631  __pyx_t_3 = 0;
13632  goto __pyx_L0;
13633 
13634  /* "View.MemoryView":576
13635  * @property
13636  * def suboffsets(self):
13637  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13638  * return (-1,) * self.view.ndim
13639  *
13640  */
13641  }
13642 
13643  /* "View.MemoryView":579
13644  * return (-1,) * self.view.ndim
13645  *
13646  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
13647  *
13648  * @property
13649  */
13650  __Pyx_XDECREF(__pyx_r);
13651  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error)
13652  __Pyx_GOTREF(__pyx_t_3);
13653  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13654  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13655  __pyx_t_4 = __pyx_t_6;
13656  __pyx_v_suboffset = (__pyx_t_4[0]);
13657  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
13658  __Pyx_GOTREF(__pyx_t_2);
13659  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 579, __pyx_L1_error)
13660  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13661  }
13662  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
13663  __Pyx_GOTREF(__pyx_t_2);
13664  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13665  __pyx_r = __pyx_t_2;
13666  __pyx_t_2 = 0;
13667  goto __pyx_L0;
13668 
13669  /* "View.MemoryView":575
13670  *
13671  * @property
13672  * def suboffsets(self): # <<<<<<<<<<<<<<
13673  * if self.view.suboffsets == NULL:
13674  * return (-1,) * self.view.ndim
13675  */
13676 
13677  /* function exit code */
13678  __pyx_L1_error:;
13679  __Pyx_XDECREF(__pyx_t_2);
13680  __Pyx_XDECREF(__pyx_t_3);
13681  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13682  __pyx_r = NULL;
13683  __pyx_L0:;
13684  __Pyx_XGIVEREF(__pyx_r);
13685  __Pyx_RefNannyFinishContext();
13686  return __pyx_r;
13687 }
13688 
13689 /* "View.MemoryView":582
13690  *
13691  * @property
13692  * def ndim(self): # <<<<<<<<<<<<<<
13693  * return self.view.ndim
13694  *
13695  */
13696 
13697 /* Python wrapper */
13698 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
13699 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13700  PyObject *__pyx_r = 0;
13701  __Pyx_RefNannyDeclarations
13702  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13703  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13704 
13705  /* function exit code */
13706  __Pyx_RefNannyFinishContext();
13707  return __pyx_r;
13708 }
13709 
13710 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13711  PyObject *__pyx_r = NULL;
13712  __Pyx_RefNannyDeclarations
13713  PyObject *__pyx_t_1 = NULL;
13714  int __pyx_lineno = 0;
13715  const char *__pyx_filename = NULL;
13716  int __pyx_clineno = 0;
13717  __Pyx_RefNannySetupContext("__get__", 0);
13718 
13719  /* "View.MemoryView":583
13720  * @property
13721  * def ndim(self):
13722  * return self.view.ndim # <<<<<<<<<<<<<<
13723  *
13724  * @property
13725  */
13726  __Pyx_XDECREF(__pyx_r);
13727  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 583, __pyx_L1_error)
13728  __Pyx_GOTREF(__pyx_t_1);
13729  __pyx_r = __pyx_t_1;
13730  __pyx_t_1 = 0;
13731  goto __pyx_L0;
13732 
13733  /* "View.MemoryView":582
13734  *
13735  * @property
13736  * def ndim(self): # <<<<<<<<<<<<<<
13737  * return self.view.ndim
13738  *
13739  */
13740 
13741  /* function exit code */
13742  __pyx_L1_error:;
13743  __Pyx_XDECREF(__pyx_t_1);
13744  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13745  __pyx_r = NULL;
13746  __pyx_L0:;
13747  __Pyx_XGIVEREF(__pyx_r);
13748  __Pyx_RefNannyFinishContext();
13749  return __pyx_r;
13750 }
13751 
13752 /* "View.MemoryView":586
13753  *
13754  * @property
13755  * def itemsize(self): # <<<<<<<<<<<<<<
13756  * return self.view.itemsize
13757  *
13758  */
13759 
13760 /* Python wrapper */
13761 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
13762 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13763  PyObject *__pyx_r = 0;
13764  __Pyx_RefNannyDeclarations
13765  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13766  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13767 
13768  /* function exit code */
13769  __Pyx_RefNannyFinishContext();
13770  return __pyx_r;
13771 }
13772 
13773 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13774  PyObject *__pyx_r = NULL;
13775  __Pyx_RefNannyDeclarations
13776  PyObject *__pyx_t_1 = NULL;
13777  int __pyx_lineno = 0;
13778  const char *__pyx_filename = NULL;
13779  int __pyx_clineno = 0;
13780  __Pyx_RefNannySetupContext("__get__", 0);
13781 
13782  /* "View.MemoryView":587
13783  * @property
13784  * def itemsize(self):
13785  * return self.view.itemsize # <<<<<<<<<<<<<<
13786  *
13787  * @property
13788  */
13789  __Pyx_XDECREF(__pyx_r);
13790  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 587, __pyx_L1_error)
13791  __Pyx_GOTREF(__pyx_t_1);
13792  __pyx_r = __pyx_t_1;
13793  __pyx_t_1 = 0;
13794  goto __pyx_L0;
13795 
13796  /* "View.MemoryView":586
13797  *
13798  * @property
13799  * def itemsize(self): # <<<<<<<<<<<<<<
13800  * return self.view.itemsize
13801  *
13802  */
13803 
13804  /* function exit code */
13805  __pyx_L1_error:;
13806  __Pyx_XDECREF(__pyx_t_1);
13807  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13808  __pyx_r = NULL;
13809  __pyx_L0:;
13810  __Pyx_XGIVEREF(__pyx_r);
13811  __Pyx_RefNannyFinishContext();
13812  return __pyx_r;
13813 }
13814 
13815 /* "View.MemoryView":590
13816  *
13817  * @property
13818  * def nbytes(self): # <<<<<<<<<<<<<<
13819  * return self.size * self.view.itemsize
13820  *
13821  */
13822 
13823 /* Python wrapper */
13824 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
13825 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13826  PyObject *__pyx_r = 0;
13827  __Pyx_RefNannyDeclarations
13828  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13829  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13830 
13831  /* function exit code */
13832  __Pyx_RefNannyFinishContext();
13833  return __pyx_r;
13834 }
13835 
13836 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13837  PyObject *__pyx_r = NULL;
13838  __Pyx_RefNannyDeclarations
13839  PyObject *__pyx_t_1 = NULL;
13840  PyObject *__pyx_t_2 = NULL;
13841  PyObject *__pyx_t_3 = NULL;
13842  int __pyx_lineno = 0;
13843  const char *__pyx_filename = NULL;
13844  int __pyx_clineno = 0;
13845  __Pyx_RefNannySetupContext("__get__", 0);
13846 
13847  /* "View.MemoryView":591
13848  * @property
13849  * def nbytes(self):
13850  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
13851  *
13852  * @property
13853  */
13854  __Pyx_XDECREF(__pyx_r);
13855  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 591, __pyx_L1_error)
13856  __Pyx_GOTREF(__pyx_t_1);
13857  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 591, __pyx_L1_error)
13858  __Pyx_GOTREF(__pyx_t_2);
13859  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 591, __pyx_L1_error)
13860  __Pyx_GOTREF(__pyx_t_3);
13861  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13862  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13863  __pyx_r = __pyx_t_3;
13864  __pyx_t_3 = 0;
13865  goto __pyx_L0;
13866 
13867  /* "View.MemoryView":590
13868  *
13869  * @property
13870  * def nbytes(self): # <<<<<<<<<<<<<<
13871  * return self.size * self.view.itemsize
13872  *
13873  */
13874 
13875  /* function exit code */
13876  __pyx_L1_error:;
13877  __Pyx_XDECREF(__pyx_t_1);
13878  __Pyx_XDECREF(__pyx_t_2);
13879  __Pyx_XDECREF(__pyx_t_3);
13880  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13881  __pyx_r = NULL;
13882  __pyx_L0:;
13883  __Pyx_XGIVEREF(__pyx_r);
13884  __Pyx_RefNannyFinishContext();
13885  return __pyx_r;
13886 }
13887 
13888 /* "View.MemoryView":594
13889  *
13890  * @property
13891  * def size(self): # <<<<<<<<<<<<<<
13892  * if self._size is None:
13893  * result = 1
13894  */
13895 
13896 /* Python wrapper */
13897 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
13898 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13899  PyObject *__pyx_r = 0;
13900  __Pyx_RefNannyDeclarations
13901  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13902  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13903 
13904  /* function exit code */
13905  __Pyx_RefNannyFinishContext();
13906  return __pyx_r;
13907 }
13908 
13909 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13910  PyObject *__pyx_v_result = NULL;
13911  PyObject *__pyx_v_length = NULL;
13912  PyObject *__pyx_r = NULL;
13913  __Pyx_RefNannyDeclarations
13914  int __pyx_t_1;
13915  int __pyx_t_2;
13916  Py_ssize_t *__pyx_t_3;
13917  Py_ssize_t *__pyx_t_4;
13918  Py_ssize_t *__pyx_t_5;
13919  PyObject *__pyx_t_6 = NULL;
13920  int __pyx_lineno = 0;
13921  const char *__pyx_filename = NULL;
13922  int __pyx_clineno = 0;
13923  __Pyx_RefNannySetupContext("__get__", 0);
13924 
13925  /* "View.MemoryView":595
13926  * @property
13927  * def size(self):
13928  * if self._size is None: # <<<<<<<<<<<<<<
13929  * result = 1
13930  *
13931  */
13932  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13933  __pyx_t_2 = (__pyx_t_1 != 0);
13934  if (__pyx_t_2) {
13935 
13936  /* "View.MemoryView":596
13937  * def size(self):
13938  * if self._size is None:
13939  * result = 1 # <<<<<<<<<<<<<<
13940  *
13941  * for length in self.view.shape[:self.view.ndim]:
13942  */
13943  __Pyx_INCREF(__pyx_int_1);
13944  __pyx_v_result = __pyx_int_1;
13945 
13946  /* "View.MemoryView":598
13947  * result = 1
13948  *
13949  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
13950  * result *= length
13951  *
13952  */
13953  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13954  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13955  __pyx_t_3 = __pyx_t_5;
13956  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 598, __pyx_L1_error)
13957  __Pyx_GOTREF(__pyx_t_6);
13958  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13959  __pyx_t_6 = 0;
13960 
13961  /* "View.MemoryView":599
13962  *
13963  * for length in self.view.shape[:self.view.ndim]:
13964  * result *= length # <<<<<<<<<<<<<<
13965  *
13966  * self._size = result
13967  */
13968  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 599, __pyx_L1_error)
13969  __Pyx_GOTREF(__pyx_t_6);
13970  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13971  __pyx_t_6 = 0;
13972  }
13973 
13974  /* "View.MemoryView":601
13975  * result *= length
13976  *
13977  * self._size = result # <<<<<<<<<<<<<<
13978  *
13979  * return self._size
13980  */
13981  __Pyx_INCREF(__pyx_v_result);
13982  __Pyx_GIVEREF(__pyx_v_result);
13983  __Pyx_GOTREF(__pyx_v_self->_size);
13984  __Pyx_DECREF(__pyx_v_self->_size);
13985  __pyx_v_self->_size = __pyx_v_result;
13986 
13987  /* "View.MemoryView":595
13988  * @property
13989  * def size(self):
13990  * if self._size is None: # <<<<<<<<<<<<<<
13991  * result = 1
13992  *
13993  */
13994  }
13995 
13996  /* "View.MemoryView":603
13997  * self._size = result
13998  *
13999  * return self._size # <<<<<<<<<<<<<<
14000  *
14001  * def __len__(self):
14002  */
14003  __Pyx_XDECREF(__pyx_r);
14004  __Pyx_INCREF(__pyx_v_self->_size);
14005  __pyx_r = __pyx_v_self->_size;
14006  goto __pyx_L0;
14007 
14008  /* "View.MemoryView":594
14009  *
14010  * @property
14011  * def size(self): # <<<<<<<<<<<<<<
14012  * if self._size is None:
14013  * result = 1
14014  */
14015 
14016  /* function exit code */
14017  __pyx_L1_error:;
14018  __Pyx_XDECREF(__pyx_t_6);
14019  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14020  __pyx_r = NULL;
14021  __pyx_L0:;
14022  __Pyx_XDECREF(__pyx_v_result);
14023  __Pyx_XDECREF(__pyx_v_length);
14024  __Pyx_XGIVEREF(__pyx_r);
14025  __Pyx_RefNannyFinishContext();
14026  return __pyx_r;
14027 }
14028 
14029 /* "View.MemoryView":605
14030  * return self._size
14031  *
14032  * def __len__(self): # <<<<<<<<<<<<<<
14033  * if self.view.ndim >= 1:
14034  * return self.view.shape[0]
14035  */
14036 
14037 /* Python wrapper */
14038 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
14039 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14040  Py_ssize_t __pyx_r;
14041  __Pyx_RefNannyDeclarations
14042  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
14043  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14044 
14045  /* function exit code */
14046  __Pyx_RefNannyFinishContext();
14047  return __pyx_r;
14048 }
14049 
14050 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
14051  Py_ssize_t __pyx_r;
14052  __Pyx_RefNannyDeclarations
14053  int __pyx_t_1;
14054  __Pyx_RefNannySetupContext("__len__", 0);
14055 
14056  /* "View.MemoryView":606
14057  *
14058  * def __len__(self):
14059  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14060  * return self.view.shape[0]
14061  *
14062  */
14063  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14064  if (__pyx_t_1) {
14065 
14066  /* "View.MemoryView":607
14067  * def __len__(self):
14068  * if self.view.ndim >= 1:
14069  * return self.view.shape[0] # <<<<<<<<<<<<<<
14070  *
14071  * return 0
14072  */
14073  __pyx_r = (__pyx_v_self->view.shape[0]);
14074  goto __pyx_L0;
14075 
14076  /* "View.MemoryView":606
14077  *
14078  * def __len__(self):
14079  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14080  * return self.view.shape[0]
14081  *
14082  */
14083  }
14084 
14085  /* "View.MemoryView":609
14086  * return self.view.shape[0]
14087  *
14088  * return 0 # <<<<<<<<<<<<<<
14089  *
14090  * def __repr__(self):
14091  */
14092  __pyx_r = 0;
14093  goto __pyx_L0;
14094 
14095  /* "View.MemoryView":605
14096  * return self._size
14097  *
14098  * def __len__(self): # <<<<<<<<<<<<<<
14099  * if self.view.ndim >= 1:
14100  * return self.view.shape[0]
14101  */
14102 
14103  /* function exit code */
14104  __pyx_L0:;
14105  __Pyx_RefNannyFinishContext();
14106  return __pyx_r;
14107 }
14108 
14109 /* "View.MemoryView":611
14110  * return 0
14111  *
14112  * def __repr__(self): # <<<<<<<<<<<<<<
14113  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14114  * id(self))
14115  */
14116 
14117 /* Python wrapper */
14118 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
14119 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14120  PyObject *__pyx_r = 0;
14121  __Pyx_RefNannyDeclarations
14122  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
14123  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14124 
14125  /* function exit code */
14126  __Pyx_RefNannyFinishContext();
14127  return __pyx_r;
14128 }
14129 
14130 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
14131  PyObject *__pyx_r = NULL;
14132  __Pyx_RefNannyDeclarations
14133  PyObject *__pyx_t_1 = NULL;
14134  PyObject *__pyx_t_2 = NULL;
14135  PyObject *__pyx_t_3 = NULL;
14136  int __pyx_lineno = 0;
14137  const char *__pyx_filename = NULL;
14138  int __pyx_clineno = 0;
14139  __Pyx_RefNannySetupContext("__repr__", 0);
14140 
14141  /* "View.MemoryView":612
14142  *
14143  * def __repr__(self):
14144  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14145  * id(self))
14146  *
14147  */
14148  __Pyx_XDECREF(__pyx_r);
14149  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
14150  __Pyx_GOTREF(__pyx_t_1);
14151  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
14152  __Pyx_GOTREF(__pyx_t_2);
14153  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14154  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
14155  __Pyx_GOTREF(__pyx_t_1);
14156  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14157 
14158  /* "View.MemoryView":613
14159  * def __repr__(self):
14160  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14161  * id(self)) # <<<<<<<<<<<<<<
14162  *
14163  * def __str__(self):
14164  */
14165  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 613, __pyx_L1_error)
14166  __Pyx_GOTREF(__pyx_t_2);
14167 
14168  /* "View.MemoryView":612
14169  *
14170  * def __repr__(self):
14171  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14172  * id(self))
14173  *
14174  */
14175  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 612, __pyx_L1_error)
14176  __Pyx_GOTREF(__pyx_t_3);
14177  __Pyx_GIVEREF(__pyx_t_1);
14178  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14179  __Pyx_GIVEREF(__pyx_t_2);
14180  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14181  __pyx_t_1 = 0;
14182  __pyx_t_2 = 0;
14183  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
14184  __Pyx_GOTREF(__pyx_t_2);
14185  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14186  __pyx_r = __pyx_t_2;
14187  __pyx_t_2 = 0;
14188  goto __pyx_L0;
14189 
14190  /* "View.MemoryView":611
14191  * return 0
14192  *
14193  * def __repr__(self): # <<<<<<<<<<<<<<
14194  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14195  * id(self))
14196  */
14197 
14198  /* function exit code */
14199  __pyx_L1_error:;
14200  __Pyx_XDECREF(__pyx_t_1);
14201  __Pyx_XDECREF(__pyx_t_2);
14202  __Pyx_XDECREF(__pyx_t_3);
14203  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14204  __pyx_r = NULL;
14205  __pyx_L0:;
14206  __Pyx_XGIVEREF(__pyx_r);
14207  __Pyx_RefNannyFinishContext();
14208  return __pyx_r;
14209 }
14210 
14211 /* "View.MemoryView":615
14212  * id(self))
14213  *
14214  * def __str__(self): # <<<<<<<<<<<<<<
14215  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14216  *
14217  */
14218 
14219 /* Python wrapper */
14220 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
14221 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14222  PyObject *__pyx_r = 0;
14223  __Pyx_RefNannyDeclarations
14224  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
14225  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14226 
14227  /* function exit code */
14228  __Pyx_RefNannyFinishContext();
14229  return __pyx_r;
14230 }
14231 
14232 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
14233  PyObject *__pyx_r = NULL;
14234  __Pyx_RefNannyDeclarations
14235  PyObject *__pyx_t_1 = NULL;
14236  PyObject *__pyx_t_2 = NULL;
14237  int __pyx_lineno = 0;
14238  const char *__pyx_filename = NULL;
14239  int __pyx_clineno = 0;
14240  __Pyx_RefNannySetupContext("__str__", 0);
14241 
14242  /* "View.MemoryView":616
14243  *
14244  * def __str__(self):
14245  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
14246  *
14247  *
14248  */
14249  __Pyx_XDECREF(__pyx_r);
14250  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
14251  __Pyx_GOTREF(__pyx_t_1);
14252  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
14253  __Pyx_GOTREF(__pyx_t_2);
14254  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14255  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
14256  __Pyx_GOTREF(__pyx_t_1);
14257  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14258  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
14259  __Pyx_GOTREF(__pyx_t_2);
14260  __Pyx_GIVEREF(__pyx_t_1);
14261  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14262  __pyx_t_1 = 0;
14263  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
14264  __Pyx_GOTREF(__pyx_t_1);
14265  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14266  __pyx_r = __pyx_t_1;
14267  __pyx_t_1 = 0;
14268  goto __pyx_L0;
14269 
14270  /* "View.MemoryView":615
14271  * id(self))
14272  *
14273  * def __str__(self): # <<<<<<<<<<<<<<
14274  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14275  *
14276  */
14277 
14278  /* function exit code */
14279  __pyx_L1_error:;
14280  __Pyx_XDECREF(__pyx_t_1);
14281  __Pyx_XDECREF(__pyx_t_2);
14282  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14283  __pyx_r = NULL;
14284  __pyx_L0:;
14285  __Pyx_XGIVEREF(__pyx_r);
14286  __Pyx_RefNannyFinishContext();
14287  return __pyx_r;
14288 }
14289 
14290 /* "View.MemoryView":619
14291  *
14292  *
14293  * def is_c_contig(self): # <<<<<<<<<<<<<<
14294  * cdef __Pyx_memviewslice *mslice
14295  * cdef __Pyx_memviewslice tmp
14296  */
14297 
14298 /* Python wrapper */
14299 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14300 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14301  PyObject *__pyx_r = 0;
14302  __Pyx_RefNannyDeclarations
14303  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
14304  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14305 
14306  /* function exit code */
14307  __Pyx_RefNannyFinishContext();
14308  return __pyx_r;
14309 }
14310 
14311 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14312  __Pyx_memviewslice *__pyx_v_mslice;
14313  __Pyx_memviewslice __pyx_v_tmp;
14314  PyObject *__pyx_r = NULL;
14315  __Pyx_RefNannyDeclarations
14316  __Pyx_memviewslice *__pyx_t_1;
14317  PyObject *__pyx_t_2 = NULL;
14318  int __pyx_lineno = 0;
14319  const char *__pyx_filename = NULL;
14320  int __pyx_clineno = 0;
14321  __Pyx_RefNannySetupContext("is_c_contig", 0);
14322 
14323  /* "View.MemoryView":622
14324  * cdef __Pyx_memviewslice *mslice
14325  * cdef __Pyx_memviewslice tmp
14326  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14327  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14328  *
14329  */
14330  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 622, __pyx_L1_error)
14331  __pyx_v_mslice = __pyx_t_1;
14332 
14333  /* "View.MemoryView":623
14334  * cdef __Pyx_memviewslice tmp
14335  * mslice = get_slice_from_memview(self, &tmp)
14336  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
14337  *
14338  * def is_f_contig(self):
14339  */
14340  __Pyx_XDECREF(__pyx_r);
14341  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 623, __pyx_L1_error)
14342  __Pyx_GOTREF(__pyx_t_2);
14343  __pyx_r = __pyx_t_2;
14344  __pyx_t_2 = 0;
14345  goto __pyx_L0;
14346 
14347  /* "View.MemoryView":619
14348  *
14349  *
14350  * def is_c_contig(self): # <<<<<<<<<<<<<<
14351  * cdef __Pyx_memviewslice *mslice
14352  * cdef __Pyx_memviewslice tmp
14353  */
14354 
14355  /* function exit code */
14356  __pyx_L1_error:;
14357  __Pyx_XDECREF(__pyx_t_2);
14358  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14359  __pyx_r = NULL;
14360  __pyx_L0:;
14361  __Pyx_XGIVEREF(__pyx_r);
14362  __Pyx_RefNannyFinishContext();
14363  return __pyx_r;
14364 }
14365 
14366 /* "View.MemoryView":625
14367  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14368  *
14369  * def is_f_contig(self): # <<<<<<<<<<<<<<
14370  * cdef __Pyx_memviewslice *mslice
14371  * cdef __Pyx_memviewslice tmp
14372  */
14373 
14374 /* Python wrapper */
14375 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14376 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14377  PyObject *__pyx_r = 0;
14378  __Pyx_RefNannyDeclarations
14379  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
14380  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14381 
14382  /* function exit code */
14383  __Pyx_RefNannyFinishContext();
14384  return __pyx_r;
14385 }
14386 
14387 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14388  __Pyx_memviewslice *__pyx_v_mslice;
14389  __Pyx_memviewslice __pyx_v_tmp;
14390  PyObject *__pyx_r = NULL;
14391  __Pyx_RefNannyDeclarations
14392  __Pyx_memviewslice *__pyx_t_1;
14393  PyObject *__pyx_t_2 = NULL;
14394  int __pyx_lineno = 0;
14395  const char *__pyx_filename = NULL;
14396  int __pyx_clineno = 0;
14397  __Pyx_RefNannySetupContext("is_f_contig", 0);
14398 
14399  /* "View.MemoryView":628
14400  * cdef __Pyx_memviewslice *mslice
14401  * cdef __Pyx_memviewslice tmp
14402  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14403  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14404  *
14405  */
14406  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 628, __pyx_L1_error)
14407  __pyx_v_mslice = __pyx_t_1;
14408 
14409  /* "View.MemoryView":629
14410  * cdef __Pyx_memviewslice tmp
14411  * mslice = get_slice_from_memview(self, &tmp)
14412  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
14413  *
14414  * def copy(self):
14415  */
14416  __Pyx_XDECREF(__pyx_r);
14417  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 629, __pyx_L1_error)
14418  __Pyx_GOTREF(__pyx_t_2);
14419  __pyx_r = __pyx_t_2;
14420  __pyx_t_2 = 0;
14421  goto __pyx_L0;
14422 
14423  /* "View.MemoryView":625
14424  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14425  *
14426  * def is_f_contig(self): # <<<<<<<<<<<<<<
14427  * cdef __Pyx_memviewslice *mslice
14428  * cdef __Pyx_memviewslice tmp
14429  */
14430 
14431  /* function exit code */
14432  __pyx_L1_error:;
14433  __Pyx_XDECREF(__pyx_t_2);
14434  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14435  __pyx_r = NULL;
14436  __pyx_L0:;
14437  __Pyx_XGIVEREF(__pyx_r);
14438  __Pyx_RefNannyFinishContext();
14439  return __pyx_r;
14440 }
14441 
14442 /* "View.MemoryView":631
14443  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14444  *
14445  * def copy(self): # <<<<<<<<<<<<<<
14446  * cdef __Pyx_memviewslice mslice
14447  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14448  */
14449 
14450 /* Python wrapper */
14451 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14452 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14453  PyObject *__pyx_r = 0;
14454  __Pyx_RefNannyDeclarations
14455  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
14456  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
14457 
14458  /* function exit code */
14459  __Pyx_RefNannyFinishContext();
14460  return __pyx_r;
14461 }
14462 
14463 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
14464  __Pyx_memviewslice __pyx_v_mslice;
14465  int __pyx_v_flags;
14466  PyObject *__pyx_r = NULL;
14467  __Pyx_RefNannyDeclarations
14468  __Pyx_memviewslice __pyx_t_1;
14469  PyObject *__pyx_t_2 = NULL;
14470  int __pyx_lineno = 0;
14471  const char *__pyx_filename = NULL;
14472  int __pyx_clineno = 0;
14473  __Pyx_RefNannySetupContext("copy", 0);
14474 
14475  /* "View.MemoryView":633
14476  * def copy(self):
14477  * cdef __Pyx_memviewslice mslice
14478  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
14479  *
14480  * slice_copy(self, &mslice)
14481  */
14482  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14483 
14484  /* "View.MemoryView":635
14485  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14486  *
14487  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
14488  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
14489  * self.view.itemsize,
14490  */
14491  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14492 
14493  /* "View.MemoryView":636
14494  *
14495  * slice_copy(self, &mslice)
14496  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
14497  * self.view.itemsize,
14498  * flags|PyBUF_C_CONTIGUOUS,
14499  */
14500  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 636, __pyx_L1_error)
14501  __pyx_v_mslice = __pyx_t_1;
14502 
14503  /* "View.MemoryView":641
14504  * self.dtype_is_object)
14505  *
14506  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
14507  *
14508  * def copy_fortran(self):
14509  */
14510  __Pyx_XDECREF(__pyx_r);
14511  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 641, __pyx_L1_error)
14512  __Pyx_GOTREF(__pyx_t_2);
14513  __pyx_r = __pyx_t_2;
14514  __pyx_t_2 = 0;
14515  goto __pyx_L0;
14516 
14517  /* "View.MemoryView":631
14518  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14519  *
14520  * def copy(self): # <<<<<<<<<<<<<<
14521  * cdef __Pyx_memviewslice mslice
14522  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14523  */
14524 
14525  /* function exit code */
14526  __pyx_L1_error:;
14527  __Pyx_XDECREF(__pyx_t_2);
14528  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14529  __pyx_r = NULL;
14530  __pyx_L0:;
14531  __Pyx_XGIVEREF(__pyx_r);
14532  __Pyx_RefNannyFinishContext();
14533  return __pyx_r;
14534 }
14535 
14536 /* "View.MemoryView":643
14537  * return memoryview_copy_from_slice(self, &mslice)
14538  *
14539  * def copy_fortran(self): # <<<<<<<<<<<<<<
14540  * cdef __Pyx_memviewslice src, dst
14541  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14542  */
14543 
14544 /* Python wrapper */
14545 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14546 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14547  PyObject *__pyx_r = 0;
14548  __Pyx_RefNannyDeclarations
14549  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
14550  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
14551 
14552  /* function exit code */
14553  __Pyx_RefNannyFinishContext();
14554  return __pyx_r;
14555 }
14556 
14557 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
14558  __Pyx_memviewslice __pyx_v_src;
14559  __Pyx_memviewslice __pyx_v_dst;
14560  int __pyx_v_flags;
14561  PyObject *__pyx_r = NULL;
14562  __Pyx_RefNannyDeclarations
14563  __Pyx_memviewslice __pyx_t_1;
14564  PyObject *__pyx_t_2 = NULL;
14565  int __pyx_lineno = 0;
14566  const char *__pyx_filename = NULL;
14567  int __pyx_clineno = 0;
14568  __Pyx_RefNannySetupContext("copy_fortran", 0);
14569 
14570  /* "View.MemoryView":645
14571  * def copy_fortran(self):
14572  * cdef __Pyx_memviewslice src, dst
14573  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
14574  *
14575  * slice_copy(self, &src)
14576  */
14577  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14578 
14579  /* "View.MemoryView":647
14580  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14581  *
14582  * slice_copy(self, &src) # <<<<<<<<<<<<<<
14583  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
14584  * self.view.itemsize,
14585  */
14586  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14587 
14588  /* "View.MemoryView":648
14589  *
14590  * slice_copy(self, &src)
14591  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
14592  * self.view.itemsize,
14593  * flags|PyBUF_F_CONTIGUOUS,
14594  */
14595  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 648, __pyx_L1_error)
14596  __pyx_v_dst = __pyx_t_1;
14597 
14598  /* "View.MemoryView":653
14599  * self.dtype_is_object)
14600  *
14601  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
14602  *
14603  *
14604  */
14605  __Pyx_XDECREF(__pyx_r);
14606  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error)
14607  __Pyx_GOTREF(__pyx_t_2);
14608  __pyx_r = __pyx_t_2;
14609  __pyx_t_2 = 0;
14610  goto __pyx_L0;
14611 
14612  /* "View.MemoryView":643
14613  * return memoryview_copy_from_slice(self, &mslice)
14614  *
14615  * def copy_fortran(self): # <<<<<<<<<<<<<<
14616  * cdef __Pyx_memviewslice src, dst
14617  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14618  */
14619 
14620  /* function exit code */
14621  __pyx_L1_error:;
14622  __Pyx_XDECREF(__pyx_t_2);
14623  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14624  __pyx_r = NULL;
14625  __pyx_L0:;
14626  __Pyx_XGIVEREF(__pyx_r);
14627  __Pyx_RefNannyFinishContext();
14628  return __pyx_r;
14629 }
14630 
14631 /* "(tree fragment)":1
14632  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14633  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14634  * def __setstate_cython__(self, __pyx_state):
14635  */
14636 
14637 /* Python wrapper */
14638 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14639 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14640  PyObject *__pyx_r = 0;
14641  __Pyx_RefNannyDeclarations
14642  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14643  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14644 
14645  /* function exit code */
14646  __Pyx_RefNannyFinishContext();
14647  return __pyx_r;
14648 }
14649 
14650 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
14651  PyObject *__pyx_r = NULL;
14652  __Pyx_RefNannyDeclarations
14653  PyObject *__pyx_t_1 = NULL;
14654  int __pyx_lineno = 0;
14655  const char *__pyx_filename = NULL;
14656  int __pyx_clineno = 0;
14657  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14658 
14659  /* "(tree fragment)":2
14660  * def __reduce_cython__(self):
14661  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14662  * def __setstate_cython__(self, __pyx_state):
14663  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14664  */
14665  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
14666  __Pyx_GOTREF(__pyx_t_1);
14667  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14668  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14669  __PYX_ERR(2, 2, __pyx_L1_error)
14670 
14671  /* "(tree fragment)":1
14672  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14673  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14674  * def __setstate_cython__(self, __pyx_state):
14675  */
14676 
14677  /* function exit code */
14678  __pyx_L1_error:;
14679  __Pyx_XDECREF(__pyx_t_1);
14680  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14681  __pyx_r = NULL;
14682  __Pyx_XGIVEREF(__pyx_r);
14683  __Pyx_RefNannyFinishContext();
14684  return __pyx_r;
14685 }
14686 
14687 /* "(tree fragment)":3
14688  * def __reduce_cython__(self):
14689  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14690  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14691  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14692  */
14693 
14694 /* Python wrapper */
14695 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
14696 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14697  PyObject *__pyx_r = 0;
14698  __Pyx_RefNannyDeclarations
14699  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14700  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14701 
14702  /* function exit code */
14703  __Pyx_RefNannyFinishContext();
14704  return __pyx_r;
14705 }
14706 
14707 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14708  PyObject *__pyx_r = NULL;
14709  __Pyx_RefNannyDeclarations
14710  PyObject *__pyx_t_1 = NULL;
14711  int __pyx_lineno = 0;
14712  const char *__pyx_filename = NULL;
14713  int __pyx_clineno = 0;
14714  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14715 
14716  /* "(tree fragment)":4
14717  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14718  * def __setstate_cython__(self, __pyx_state):
14719  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14720  */
14721  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
14722  __Pyx_GOTREF(__pyx_t_1);
14723  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14724  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14725  __PYX_ERR(2, 4, __pyx_L1_error)
14726 
14727  /* "(tree fragment)":3
14728  * def __reduce_cython__(self):
14729  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14730  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14731  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14732  */
14733 
14734  /* function exit code */
14735  __pyx_L1_error:;
14736  __Pyx_XDECREF(__pyx_t_1);
14737  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14738  __pyx_r = NULL;
14739  __Pyx_XGIVEREF(__pyx_r);
14740  __Pyx_RefNannyFinishContext();
14741  return __pyx_r;
14742 }
14743 
14744 /* "View.MemoryView":657
14745  *
14746  * @cname('__pyx_memoryview_new')
14747  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14748  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14749  * result.typeinfo = typeinfo
14750  */
14751 
14752 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14753  struct __pyx_memoryview_obj *__pyx_v_result = 0;
14754  PyObject *__pyx_r = NULL;
14755  __Pyx_RefNannyDeclarations
14756  PyObject *__pyx_t_1 = NULL;
14757  PyObject *__pyx_t_2 = NULL;
14758  PyObject *__pyx_t_3 = NULL;
14759  int __pyx_lineno = 0;
14760  const char *__pyx_filename = NULL;
14761  int __pyx_clineno = 0;
14762  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
14763 
14764  /* "View.MemoryView":658
14765  * @cname('__pyx_memoryview_new')
14766  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14767  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
14768  * result.typeinfo = typeinfo
14769  * return result
14770  */
14771  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 658, __pyx_L1_error)
14772  __Pyx_GOTREF(__pyx_t_1);
14773  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
14774  __Pyx_GOTREF(__pyx_t_2);
14775  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error)
14776  __Pyx_GOTREF(__pyx_t_3);
14777  __Pyx_INCREF(__pyx_v_o);
14778  __Pyx_GIVEREF(__pyx_v_o);
14779  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14780  __Pyx_GIVEREF(__pyx_t_1);
14781  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14782  __Pyx_GIVEREF(__pyx_t_2);
14783  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14784  __pyx_t_1 = 0;
14785  __pyx_t_2 = 0;
14786  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
14787  __Pyx_GOTREF(__pyx_t_2);
14788  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14789  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14790  __pyx_t_2 = 0;
14791 
14792  /* "View.MemoryView":659
14793  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14794  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14795  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
14796  * return result
14797  *
14798  */
14799  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14800 
14801  /* "View.MemoryView":660
14802  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14803  * result.typeinfo = typeinfo
14804  * return result # <<<<<<<<<<<<<<
14805  *
14806  * @cname('__pyx_memoryview_check')
14807  */
14808  __Pyx_XDECREF(__pyx_r);
14809  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14810  __pyx_r = ((PyObject *)__pyx_v_result);
14811  goto __pyx_L0;
14812 
14813  /* "View.MemoryView":657
14814  *
14815  * @cname('__pyx_memoryview_new')
14816  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14817  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14818  * result.typeinfo = typeinfo
14819  */
14820 
14821  /* function exit code */
14822  __pyx_L1_error:;
14823  __Pyx_XDECREF(__pyx_t_1);
14824  __Pyx_XDECREF(__pyx_t_2);
14825  __Pyx_XDECREF(__pyx_t_3);
14826  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14827  __pyx_r = 0;
14828  __pyx_L0:;
14829  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14830  __Pyx_XGIVEREF(__pyx_r);
14831  __Pyx_RefNannyFinishContext();
14832  return __pyx_r;
14833 }
14834 
14835 /* "View.MemoryView":663
14836  *
14837  * @cname('__pyx_memoryview_check')
14838  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14839  * return isinstance(o, memoryview)
14840  *
14841  */
14842 
14843 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14844  int __pyx_r;
14845  __Pyx_RefNannyDeclarations
14846  int __pyx_t_1;
14847  __Pyx_RefNannySetupContext("memoryview_check", 0);
14848 
14849  /* "View.MemoryView":664
14850  * @cname('__pyx_memoryview_check')
14851  * cdef inline bint memoryview_check(object o):
14852  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
14853  *
14854  * cdef tuple _unellipsify(object index, int ndim):
14855  */
14856  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14857  __pyx_r = __pyx_t_1;
14858  goto __pyx_L0;
14859 
14860  /* "View.MemoryView":663
14861  *
14862  * @cname('__pyx_memoryview_check')
14863  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14864  * return isinstance(o, memoryview)
14865  *
14866  */
14867 
14868  /* function exit code */
14869  __pyx_L0:;
14870  __Pyx_RefNannyFinishContext();
14871  return __pyx_r;
14872 }
14873 
14874 /* "View.MemoryView":666
14875  * return isinstance(o, memoryview)
14876  *
14877  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14878  * """
14879  * Replace all ellipses with full slices and fill incomplete indices with
14880  */
14881 
14882 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
14883  PyObject *__pyx_v_tup = NULL;
14884  PyObject *__pyx_v_result = NULL;
14885  int __pyx_v_have_slices;
14886  int __pyx_v_seen_ellipsis;
14887  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14888  PyObject *__pyx_v_item = NULL;
14889  Py_ssize_t __pyx_v_nslices;
14890  PyObject *__pyx_r = NULL;
14891  __Pyx_RefNannyDeclarations
14892  int __pyx_t_1;
14893  int __pyx_t_2;
14894  PyObject *__pyx_t_3 = NULL;
14895  PyObject *__pyx_t_4 = NULL;
14896  Py_ssize_t __pyx_t_5;
14897  PyObject *(*__pyx_t_6)(PyObject *);
14898  PyObject *__pyx_t_7 = NULL;
14899  Py_ssize_t __pyx_t_8;
14900  int __pyx_t_9;
14901  int __pyx_t_10;
14902  PyObject *__pyx_t_11 = NULL;
14903  int __pyx_lineno = 0;
14904  const char *__pyx_filename = NULL;
14905  int __pyx_clineno = 0;
14906  __Pyx_RefNannySetupContext("_unellipsify", 0);
14907 
14908  /* "View.MemoryView":671
14909  * full slices.
14910  * """
14911  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14912  * tup = (index,)
14913  * else:
14914  */
14915  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14916  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14917  if (__pyx_t_2) {
14918 
14919  /* "View.MemoryView":672
14920  * """
14921  * if not isinstance(index, tuple):
14922  * tup = (index,) # <<<<<<<<<<<<<<
14923  * else:
14924  * tup = index
14925  */
14926  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 672, __pyx_L1_error)
14927  __Pyx_GOTREF(__pyx_t_3);
14928  __Pyx_INCREF(__pyx_v_index);
14929  __Pyx_GIVEREF(__pyx_v_index);
14930  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14931  __pyx_v_tup = __pyx_t_3;
14932  __pyx_t_3 = 0;
14933 
14934  /* "View.MemoryView":671
14935  * full slices.
14936  * """
14937  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14938  * tup = (index,)
14939  * else:
14940  */
14941  goto __pyx_L3;
14942  }
14943 
14944  /* "View.MemoryView":674
14945  * tup = (index,)
14946  * else:
14947  * tup = index # <<<<<<<<<<<<<<
14948  *
14949  * result = []
14950  */
14951  /*else*/ {
14952  __Pyx_INCREF(__pyx_v_index);
14953  __pyx_v_tup = __pyx_v_index;
14954  }
14955  __pyx_L3:;
14956 
14957  /* "View.MemoryView":676
14958  * tup = index
14959  *
14960  * result = [] # <<<<<<<<<<<<<<
14961  * have_slices = False
14962  * seen_ellipsis = False
14963  */
14964  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 676, __pyx_L1_error)
14965  __Pyx_GOTREF(__pyx_t_3);
14966  __pyx_v_result = ((PyObject*)__pyx_t_3);
14967  __pyx_t_3 = 0;
14968 
14969  /* "View.MemoryView":677
14970  *
14971  * result = []
14972  * have_slices = False # <<<<<<<<<<<<<<
14973  * seen_ellipsis = False
14974  * for idx, item in enumerate(tup):
14975  */
14976  __pyx_v_have_slices = 0;
14977 
14978  /* "View.MemoryView":678
14979  * result = []
14980  * have_slices = False
14981  * seen_ellipsis = False # <<<<<<<<<<<<<<
14982  * for idx, item in enumerate(tup):
14983  * if item is Ellipsis:
14984  */
14985  __pyx_v_seen_ellipsis = 0;
14986 
14987  /* "View.MemoryView":679
14988  * have_slices = False
14989  * seen_ellipsis = False
14990  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14991  * if item is Ellipsis:
14992  * if not seen_ellipsis:
14993  */
14994  __Pyx_INCREF(__pyx_int_0);
14995  __pyx_t_3 = __pyx_int_0;
14996  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14997  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14998  __pyx_t_6 = NULL;
14999  } else {
15000  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 679, __pyx_L1_error)
15001  __Pyx_GOTREF(__pyx_t_4);
15002  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 679, __pyx_L1_error)
15003  }
15004  for (;;) {
15005  if (likely(!__pyx_t_6)) {
15006  if (likely(PyList_CheckExact(__pyx_t_4))) {
15007  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
15008  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15009  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error)
15010  #else
15011  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
15012  __Pyx_GOTREF(__pyx_t_7);
15013  #endif
15014  } else {
15015  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
15016  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15017  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error)
15018  #else
15019  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
15020  __Pyx_GOTREF(__pyx_t_7);
15021  #endif
15022  }
15023  } else {
15024  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15025  if (unlikely(!__pyx_t_7)) {
15026  PyObject* exc_type = PyErr_Occurred();
15027  if (exc_type) {
15028  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15029  else __PYX_ERR(2, 679, __pyx_L1_error)
15030  }
15031  break;
15032  }
15033  __Pyx_GOTREF(__pyx_t_7);
15034  }
15035  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15036  __pyx_t_7 = 0;
15037  __Pyx_INCREF(__pyx_t_3);
15038  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15039  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
15040  __Pyx_GOTREF(__pyx_t_7);
15041  __Pyx_DECREF(__pyx_t_3);
15042  __pyx_t_3 = __pyx_t_7;
15043  __pyx_t_7 = 0;
15044 
15045  /* "View.MemoryView":680
15046  * seen_ellipsis = False
15047  * for idx, item in enumerate(tup):
15048  * if item is Ellipsis: # <<<<<<<<<<<<<<
15049  * if not seen_ellipsis:
15050  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15051  */
15052  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15053  __pyx_t_1 = (__pyx_t_2 != 0);
15054  if (__pyx_t_1) {
15055 
15056  /* "View.MemoryView":681
15057  * for idx, item in enumerate(tup):
15058  * if item is Ellipsis:
15059  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15060  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15061  * seen_ellipsis = True
15062  */
15063  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15064  if (__pyx_t_1) {
15065 
15066  /* "View.MemoryView":682
15067  * if item is Ellipsis:
15068  * if not seen_ellipsis:
15069  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
15070  * seen_ellipsis = True
15071  * else:
15072  */
15073  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
15074  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 682, __pyx_L1_error)
15075  __Pyx_GOTREF(__pyx_t_7);
15076  { Py_ssize_t __pyx_temp;
15077  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15078  __Pyx_INCREF(__pyx_slice__20);
15079  __Pyx_GIVEREF(__pyx_slice__20);
15080  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__20);
15081  }
15082  }
15083  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
15084  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15085 
15086  /* "View.MemoryView":683
15087  * if not seen_ellipsis:
15088  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15089  * seen_ellipsis = True # <<<<<<<<<<<<<<
15090  * else:
15091  * result.append(slice(None))
15092  */
15093  __pyx_v_seen_ellipsis = 1;
15094 
15095  /* "View.MemoryView":681
15096  * for idx, item in enumerate(tup):
15097  * if item is Ellipsis:
15098  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15099  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15100  * seen_ellipsis = True
15101  */
15102  goto __pyx_L7;
15103  }
15104 
15105  /* "View.MemoryView":685
15106  * seen_ellipsis = True
15107  * else:
15108  * result.append(slice(None)) # <<<<<<<<<<<<<<
15109  * have_slices = True
15110  * else:
15111  */
15112  /*else*/ {
15113  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__20); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 685, __pyx_L1_error)
15114  }
15115  __pyx_L7:;
15116 
15117  /* "View.MemoryView":686
15118  * else:
15119  * result.append(slice(None))
15120  * have_slices = True # <<<<<<<<<<<<<<
15121  * else:
15122  * if not isinstance(item, slice) and not PyIndex_Check(item):
15123  */
15124  __pyx_v_have_slices = 1;
15125 
15126  /* "View.MemoryView":680
15127  * seen_ellipsis = False
15128  * for idx, item in enumerate(tup):
15129  * if item is Ellipsis: # <<<<<<<<<<<<<<
15130  * if not seen_ellipsis:
15131  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15132  */
15133  goto __pyx_L6;
15134  }
15135 
15136  /* "View.MemoryView":688
15137  * have_slices = True
15138  * else:
15139  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15140  * raise TypeError("Cannot index with type '%s'" % type(item))
15141  *
15142  */
15143  /*else*/ {
15144  __pyx_t_2 = PySlice_Check(__pyx_v_item);
15145  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15146  if (__pyx_t_10) {
15147  } else {
15148  __pyx_t_1 = __pyx_t_10;
15149  goto __pyx_L9_bool_binop_done;
15150  }
15151  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15152  __pyx_t_1 = __pyx_t_10;
15153  __pyx_L9_bool_binop_done:;
15154  if (unlikely(__pyx_t_1)) {
15155 
15156  /* "View.MemoryView":689
15157  * else:
15158  * if not isinstance(item, slice) and not PyIndex_Check(item):
15159  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
15160  *
15161  * have_slices = have_slices or isinstance(item, slice)
15162  */
15163  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 689, __pyx_L1_error)
15164  __Pyx_GOTREF(__pyx_t_7);
15165  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 689, __pyx_L1_error)
15166  __Pyx_GOTREF(__pyx_t_11);
15167  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15168  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15169  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15170  __PYX_ERR(2, 689, __pyx_L1_error)
15171 
15172  /* "View.MemoryView":688
15173  * have_slices = True
15174  * else:
15175  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15176  * raise TypeError("Cannot index with type '%s'" % type(item))
15177  *
15178  */
15179  }
15180 
15181  /* "View.MemoryView":691
15182  * raise TypeError("Cannot index with type '%s'" % type(item))
15183  *
15184  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
15185  * result.append(item)
15186  *
15187  */
15188  __pyx_t_10 = (__pyx_v_have_slices != 0);
15189  if (!__pyx_t_10) {
15190  } else {
15191  __pyx_t_1 = __pyx_t_10;
15192  goto __pyx_L11_bool_binop_done;
15193  }
15194  __pyx_t_10 = PySlice_Check(__pyx_v_item);
15195  __pyx_t_2 = (__pyx_t_10 != 0);
15196  __pyx_t_1 = __pyx_t_2;
15197  __pyx_L11_bool_binop_done:;
15198  __pyx_v_have_slices = __pyx_t_1;
15199 
15200  /* "View.MemoryView":692
15201  *
15202  * have_slices = have_slices or isinstance(item, slice)
15203  * result.append(item) # <<<<<<<<<<<<<<
15204  *
15205  * nslices = ndim - len(result)
15206  */
15207  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error)
15208  }
15209  __pyx_L6:;
15210 
15211  /* "View.MemoryView":679
15212  * have_slices = False
15213  * seen_ellipsis = False
15214  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15215  * if item is Ellipsis:
15216  * if not seen_ellipsis:
15217  */
15218  }
15219  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15220  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15221 
15222  /* "View.MemoryView":694
15223  * result.append(item)
15224  *
15225  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
15226  * if nslices:
15227  * result.extend([slice(None)] * nslices)
15228  */
15229  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 694, __pyx_L1_error)
15230  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15231 
15232  /* "View.MemoryView":695
15233  *
15234  * nslices = ndim - len(result)
15235  * if nslices: # <<<<<<<<<<<<<<
15236  * result.extend([slice(None)] * nslices)
15237  *
15238  */
15239  __pyx_t_1 = (__pyx_v_nslices != 0);
15240  if (__pyx_t_1) {
15241 
15242  /* "View.MemoryView":696
15243  * nslices = ndim - len(result)
15244  * if nslices:
15245  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
15246  *
15247  * return have_slices or nslices, tuple(result)
15248  */
15249  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 696, __pyx_L1_error)
15250  __Pyx_GOTREF(__pyx_t_3);
15251  { Py_ssize_t __pyx_temp;
15252  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15253  __Pyx_INCREF(__pyx_slice__20);
15254  __Pyx_GIVEREF(__pyx_slice__20);
15255  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__20);
15256  }
15257  }
15258  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 696, __pyx_L1_error)
15259  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15260 
15261  /* "View.MemoryView":695
15262  *
15263  * nslices = ndim - len(result)
15264  * if nslices: # <<<<<<<<<<<<<<
15265  * result.extend([slice(None)] * nslices)
15266  *
15267  */
15268  }
15269 
15270  /* "View.MemoryView":698
15271  * result.extend([slice(None)] * nslices)
15272  *
15273  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
15274  *
15275  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15276  */
15277  __Pyx_XDECREF(__pyx_r);
15278  if (!__pyx_v_have_slices) {
15279  } else {
15280  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
15281  __Pyx_GOTREF(__pyx_t_4);
15282  __pyx_t_3 = __pyx_t_4;
15283  __pyx_t_4 = 0;
15284  goto __pyx_L14_bool_binop_done;
15285  }
15286  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
15287  __Pyx_GOTREF(__pyx_t_4);
15288  __pyx_t_3 = __pyx_t_4;
15289  __pyx_t_4 = 0;
15290  __pyx_L14_bool_binop_done:;
15291  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
15292  __Pyx_GOTREF(__pyx_t_4);
15293  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 698, __pyx_L1_error)
15294  __Pyx_GOTREF(__pyx_t_11);
15295  __Pyx_GIVEREF(__pyx_t_3);
15296  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15297  __Pyx_GIVEREF(__pyx_t_4);
15298  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15299  __pyx_t_3 = 0;
15300  __pyx_t_4 = 0;
15301  __pyx_r = ((PyObject*)__pyx_t_11);
15302  __pyx_t_11 = 0;
15303  goto __pyx_L0;
15304 
15305  /* "View.MemoryView":666
15306  * return isinstance(o, memoryview)
15307  *
15308  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15309  * """
15310  * Replace all ellipses with full slices and fill incomplete indices with
15311  */
15312 
15313  /* function exit code */
15314  __pyx_L1_error:;
15315  __Pyx_XDECREF(__pyx_t_3);
15316  __Pyx_XDECREF(__pyx_t_4);
15317  __Pyx_XDECREF(__pyx_t_7);
15318  __Pyx_XDECREF(__pyx_t_11);
15319  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15320  __pyx_r = 0;
15321  __pyx_L0:;
15322  __Pyx_XDECREF(__pyx_v_tup);
15323  __Pyx_XDECREF(__pyx_v_result);
15324  __Pyx_XDECREF(__pyx_v_idx);
15325  __Pyx_XDECREF(__pyx_v_item);
15326  __Pyx_XGIVEREF(__pyx_r);
15327  __Pyx_RefNannyFinishContext();
15328  return __pyx_r;
15329 }
15330 
15331 /* "View.MemoryView":700
15332  * return have_slices or nslices, tuple(result)
15333  *
15334  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15335  * for suboffset in suboffsets[:ndim]:
15336  * if suboffset >= 0:
15337  */
15338 
15339 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
15340  Py_ssize_t __pyx_v_suboffset;
15341  PyObject *__pyx_r = NULL;
15342  __Pyx_RefNannyDeclarations
15343  Py_ssize_t *__pyx_t_1;
15344  Py_ssize_t *__pyx_t_2;
15345  Py_ssize_t *__pyx_t_3;
15346  int __pyx_t_4;
15347  PyObject *__pyx_t_5 = NULL;
15348  int __pyx_lineno = 0;
15349  const char *__pyx_filename = NULL;
15350  int __pyx_clineno = 0;
15351  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
15352 
15353  /* "View.MemoryView":701
15354  *
15355  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15356  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
15357  * if suboffset >= 0:
15358  * raise ValueError("Indirect dimensions not supported")
15359  */
15360  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15361  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15362  __pyx_t_1 = __pyx_t_3;
15363  __pyx_v_suboffset = (__pyx_t_1[0]);
15364 
15365  /* "View.MemoryView":702
15366  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15367  * for suboffset in suboffsets[:ndim]:
15368  * if suboffset >= 0: # <<<<<<<<<<<<<<
15369  * raise ValueError("Indirect dimensions not supported")
15370  *
15371  */
15372  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15373  if (unlikely(__pyx_t_4)) {
15374 
15375  /* "View.MemoryView":703
15376  * for suboffset in suboffsets[:ndim]:
15377  * if suboffset >= 0:
15378  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
15379  *
15380  *
15381  */
15382  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 703, __pyx_L1_error)
15383  __Pyx_GOTREF(__pyx_t_5);
15384  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15385  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15386  __PYX_ERR(2, 703, __pyx_L1_error)
15387 
15388  /* "View.MemoryView":702
15389  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15390  * for suboffset in suboffsets[:ndim]:
15391  * if suboffset >= 0: # <<<<<<<<<<<<<<
15392  * raise ValueError("Indirect dimensions not supported")
15393  *
15394  */
15395  }
15396  }
15397 
15398  /* "View.MemoryView":700
15399  * return have_slices or nslices, tuple(result)
15400  *
15401  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15402  * for suboffset in suboffsets[:ndim]:
15403  * if suboffset >= 0:
15404  */
15405 
15406  /* function exit code */
15407  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15408  goto __pyx_L0;
15409  __pyx_L1_error:;
15410  __Pyx_XDECREF(__pyx_t_5);
15411  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15412  __pyx_r = 0;
15413  __pyx_L0:;
15414  __Pyx_XGIVEREF(__pyx_r);
15415  __Pyx_RefNannyFinishContext();
15416  return __pyx_r;
15417 }
15418 
15419 /* "View.MemoryView":710
15420  *
15421  * @cname('__pyx_memview_slice')
15422  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15423  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15424  * cdef bint negative_step
15425  */
15426 
15427 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15428  int __pyx_v_new_ndim;
15429  int __pyx_v_suboffset_dim;
15430  int __pyx_v_dim;
15431  __Pyx_memviewslice __pyx_v_src;
15432  __Pyx_memviewslice __pyx_v_dst;
15433  __Pyx_memviewslice *__pyx_v_p_src;
15434  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15435  __Pyx_memviewslice *__pyx_v_p_dst;
15436  int *__pyx_v_p_suboffset_dim;
15437  Py_ssize_t __pyx_v_start;
15438  Py_ssize_t __pyx_v_stop;
15439  Py_ssize_t __pyx_v_step;
15440  int __pyx_v_have_start;
15441  int __pyx_v_have_stop;
15442  int __pyx_v_have_step;
15443  PyObject *__pyx_v_index = NULL;
15444  struct __pyx_memoryview_obj *__pyx_r = NULL;
15445  __Pyx_RefNannyDeclarations
15446  int __pyx_t_1;
15447  int __pyx_t_2;
15448  PyObject *__pyx_t_3 = NULL;
15449  struct __pyx_memoryview_obj *__pyx_t_4;
15450  char *__pyx_t_5;
15451  int __pyx_t_6;
15452  Py_ssize_t __pyx_t_7;
15453  PyObject *(*__pyx_t_8)(PyObject *);
15454  PyObject *__pyx_t_9 = NULL;
15455  Py_ssize_t __pyx_t_10;
15456  int __pyx_t_11;
15457  Py_ssize_t __pyx_t_12;
15458  int __pyx_lineno = 0;
15459  const char *__pyx_filename = NULL;
15460  int __pyx_clineno = 0;
15461  __Pyx_RefNannySetupContext("memview_slice", 0);
15462 
15463  /* "View.MemoryView":711
15464  * @cname('__pyx_memview_slice')
15465  * cdef memoryview memview_slice(memoryview memview, object indices):
15466  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
15467  * cdef bint negative_step
15468  * cdef __Pyx_memviewslice src, dst
15469  */
15470  __pyx_v_new_ndim = 0;
15471  __pyx_v_suboffset_dim = -1;
15472 
15473  /* "View.MemoryView":718
15474  *
15475  *
15476  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
15477  *
15478  * cdef _memoryviewslice memviewsliceobj
15479  */
15480  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
15481 
15482  /* "View.MemoryView":722
15483  * cdef _memoryviewslice memviewsliceobj
15484  *
15485  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
15486  *
15487  * if isinstance(memview, _memoryviewslice):
15488  */
15489  #ifndef CYTHON_WITHOUT_ASSERTIONS
15490  if (unlikely(!Py_OptimizeFlag)) {
15491  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15492  PyErr_SetNone(PyExc_AssertionError);
15493  __PYX_ERR(2, 722, __pyx_L1_error)
15494  }
15495  }
15496  #endif
15497 
15498  /* "View.MemoryView":724
15499  * assert memview.view.ndim > 0
15500  *
15501  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15502  * memviewsliceobj = memview
15503  * p_src = &memviewsliceobj.from_slice
15504  */
15505  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15506  __pyx_t_2 = (__pyx_t_1 != 0);
15507  if (__pyx_t_2) {
15508 
15509  /* "View.MemoryView":725
15510  *
15511  * if isinstance(memview, _memoryviewslice):
15512  * memviewsliceobj = memview # <<<<<<<<<<<<<<
15513  * p_src = &memviewsliceobj.from_slice
15514  * else:
15515  */
15516  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 725, __pyx_L1_error)
15517  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15518  __Pyx_INCREF(__pyx_t_3);
15519  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15520  __pyx_t_3 = 0;
15521 
15522  /* "View.MemoryView":726
15523  * if isinstance(memview, _memoryviewslice):
15524  * memviewsliceobj = memview
15525  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
15526  * else:
15527  * slice_copy(memview, &src)
15528  */
15529  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15530 
15531  /* "View.MemoryView":724
15532  * assert memview.view.ndim > 0
15533  *
15534  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15535  * memviewsliceobj = memview
15536  * p_src = &memviewsliceobj.from_slice
15537  */
15538  goto __pyx_L3;
15539  }
15540 
15541  /* "View.MemoryView":728
15542  * p_src = &memviewsliceobj.from_slice
15543  * else:
15544  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
15545  * p_src = &src
15546  *
15547  */
15548  /*else*/ {
15549  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15550 
15551  /* "View.MemoryView":729
15552  * else:
15553  * slice_copy(memview, &src)
15554  * p_src = &src # <<<<<<<<<<<<<<
15555  *
15556  *
15557  */
15558  __pyx_v_p_src = (&__pyx_v_src);
15559  }
15560  __pyx_L3:;
15561 
15562  /* "View.MemoryView":735
15563  *
15564  *
15565  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
15566  * dst.data = p_src.data
15567  *
15568  */
15569  __pyx_t_4 = __pyx_v_p_src->memview;
15570  __pyx_v_dst.memview = __pyx_t_4;
15571 
15572  /* "View.MemoryView":736
15573  *
15574  * dst.memview = p_src.memview
15575  * dst.data = p_src.data # <<<<<<<<<<<<<<
15576  *
15577  *
15578  */
15579  __pyx_t_5 = __pyx_v_p_src->data;
15580  __pyx_v_dst.data = __pyx_t_5;
15581 
15582  /* "View.MemoryView":741
15583  *
15584  *
15585  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
15586  * cdef int *p_suboffset_dim = &suboffset_dim
15587  * cdef Py_ssize_t start, stop, step
15588  */
15589  __pyx_v_p_dst = (&__pyx_v_dst);
15590 
15591  /* "View.MemoryView":742
15592  *
15593  * cdef __Pyx_memviewslice *p_dst = &dst
15594  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
15595  * cdef Py_ssize_t start, stop, step
15596  * cdef bint have_start, have_stop, have_step
15597  */
15598  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15599 
15600  /* "View.MemoryView":746
15601  * cdef bint have_start, have_stop, have_step
15602  *
15603  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15604  * if PyIndex_Check(index):
15605  * slice_memviewslice(
15606  */
15607  __pyx_t_6 = 0;
15608  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15609  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15610  __pyx_t_8 = NULL;
15611  } else {
15612  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 746, __pyx_L1_error)
15613  __Pyx_GOTREF(__pyx_t_3);
15614  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 746, __pyx_L1_error)
15615  }
15616  for (;;) {
15617  if (likely(!__pyx_t_8)) {
15618  if (likely(PyList_CheckExact(__pyx_t_3))) {
15619  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
15620  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15621  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error)
15622  #else
15623  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
15624  __Pyx_GOTREF(__pyx_t_9);
15625  #endif
15626  } else {
15627  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
15628  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15629  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error)
15630  #else
15631  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
15632  __Pyx_GOTREF(__pyx_t_9);
15633  #endif
15634  }
15635  } else {
15636  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15637  if (unlikely(!__pyx_t_9)) {
15638  PyObject* exc_type = PyErr_Occurred();
15639  if (exc_type) {
15640  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15641  else __PYX_ERR(2, 746, __pyx_L1_error)
15642  }
15643  break;
15644  }
15645  __Pyx_GOTREF(__pyx_t_9);
15646  }
15647  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15648  __pyx_t_9 = 0;
15649  __pyx_v_dim = __pyx_t_6;
15650  __pyx_t_6 = (__pyx_t_6 + 1);
15651 
15652  /* "View.MemoryView":747
15653  *
15654  * for dim, index in enumerate(indices):
15655  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15656  * slice_memviewslice(
15657  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15658  */
15659  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15660  if (__pyx_t_2) {
15661 
15662  /* "View.MemoryView":751
15663  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15664  * dim, new_ndim, p_suboffset_dim,
15665  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
15666  * 0, 0, 0, # have_{start,stop,step}
15667  * False)
15668  */
15669  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 751, __pyx_L1_error)
15670 
15671  /* "View.MemoryView":748
15672  * for dim, index in enumerate(indices):
15673  * if PyIndex_Check(index):
15674  * slice_memviewslice( # <<<<<<<<<<<<<<
15675  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15676  * dim, new_ndim, p_suboffset_dim,
15677  */
15678  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 748, __pyx_L1_error)
15679 
15680  /* "View.MemoryView":747
15681  *
15682  * for dim, index in enumerate(indices):
15683  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15684  * slice_memviewslice(
15685  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15686  */
15687  goto __pyx_L6;
15688  }
15689 
15690  /* "View.MemoryView":754
15691  * 0, 0, 0, # have_{start,stop,step}
15692  * False)
15693  * elif index is None: # <<<<<<<<<<<<<<
15694  * p_dst.shape[new_ndim] = 1
15695  * p_dst.strides[new_ndim] = 0
15696  */
15697  __pyx_t_2 = (__pyx_v_index == Py_None);
15698  __pyx_t_1 = (__pyx_t_2 != 0);
15699  if (__pyx_t_1) {
15700 
15701  /* "View.MemoryView":755
15702  * False)
15703  * elif index is None:
15704  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
15705  * p_dst.strides[new_ndim] = 0
15706  * p_dst.suboffsets[new_ndim] = -1
15707  */
15708  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15709 
15710  /* "View.MemoryView":756
15711  * elif index is None:
15712  * p_dst.shape[new_ndim] = 1
15713  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
15714  * p_dst.suboffsets[new_ndim] = -1
15715  * new_ndim += 1
15716  */
15717  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15718 
15719  /* "View.MemoryView":757
15720  * p_dst.shape[new_ndim] = 1
15721  * p_dst.strides[new_ndim] = 0
15722  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
15723  * new_ndim += 1
15724  * else:
15725  */
15726  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15727 
15728  /* "View.MemoryView":758
15729  * p_dst.strides[new_ndim] = 0
15730  * p_dst.suboffsets[new_ndim] = -1
15731  * new_ndim += 1 # <<<<<<<<<<<<<<
15732  * else:
15733  * start = index.start or 0
15734  */
15735  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15736 
15737  /* "View.MemoryView":754
15738  * 0, 0, 0, # have_{start,stop,step}
15739  * False)
15740  * elif index is None: # <<<<<<<<<<<<<<
15741  * p_dst.shape[new_ndim] = 1
15742  * p_dst.strides[new_ndim] = 0
15743  */
15744  goto __pyx_L6;
15745  }
15746 
15747  /* "View.MemoryView":760
15748  * new_ndim += 1
15749  * else:
15750  * start = index.start or 0 # <<<<<<<<<<<<<<
15751  * stop = index.stop or 0
15752  * step = index.step or 0
15753  */
15754  /*else*/ {
15755  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 760, __pyx_L1_error)
15756  __Pyx_GOTREF(__pyx_t_9);
15757  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 760, __pyx_L1_error)
15758  if (!__pyx_t_1) {
15759  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15760  } else {
15761  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 760, __pyx_L1_error)
15762  __pyx_t_10 = __pyx_t_12;
15763  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15764  goto __pyx_L7_bool_binop_done;
15765  }
15766  __pyx_t_10 = 0;
15767  __pyx_L7_bool_binop_done:;
15768  __pyx_v_start = __pyx_t_10;
15769 
15770  /* "View.MemoryView":761
15771  * else:
15772  * start = index.start or 0
15773  * stop = index.stop or 0 # <<<<<<<<<<<<<<
15774  * step = index.step or 0
15775  *
15776  */
15777  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 761, __pyx_L1_error)
15778  __Pyx_GOTREF(__pyx_t_9);
15779  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 761, __pyx_L1_error)
15780  if (!__pyx_t_1) {
15781  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15782  } else {
15783  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 761, __pyx_L1_error)
15784  __pyx_t_10 = __pyx_t_12;
15785  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15786  goto __pyx_L9_bool_binop_done;
15787  }
15788  __pyx_t_10 = 0;
15789  __pyx_L9_bool_binop_done:;
15790  __pyx_v_stop = __pyx_t_10;
15791 
15792  /* "View.MemoryView":762
15793  * start = index.start or 0
15794  * stop = index.stop or 0
15795  * step = index.step or 0 # <<<<<<<<<<<<<<
15796  *
15797  * have_start = index.start is not None
15798  */
15799  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error)
15800  __Pyx_GOTREF(__pyx_t_9);
15801  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error)
15802  if (!__pyx_t_1) {
15803  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15804  } else {
15805  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error)
15806  __pyx_t_10 = __pyx_t_12;
15807  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15808  goto __pyx_L11_bool_binop_done;
15809  }
15810  __pyx_t_10 = 0;
15811  __pyx_L11_bool_binop_done:;
15812  __pyx_v_step = __pyx_t_10;
15813 
15814  /* "View.MemoryView":764
15815  * step = index.step or 0
15816  *
15817  * have_start = index.start is not None # <<<<<<<<<<<<<<
15818  * have_stop = index.stop is not None
15819  * have_step = index.step is not None
15820  */
15821  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error)
15822  __Pyx_GOTREF(__pyx_t_9);
15823  __pyx_t_1 = (__pyx_t_9 != Py_None);
15824  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15825  __pyx_v_have_start = __pyx_t_1;
15826 
15827  /* "View.MemoryView":765
15828  *
15829  * have_start = index.start is not None
15830  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
15831  * have_step = index.step is not None
15832  *
15833  */
15834  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 765, __pyx_L1_error)
15835  __Pyx_GOTREF(__pyx_t_9);
15836  __pyx_t_1 = (__pyx_t_9 != Py_None);
15837  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15838  __pyx_v_have_stop = __pyx_t_1;
15839 
15840  /* "View.MemoryView":766
15841  * have_start = index.start is not None
15842  * have_stop = index.stop is not None
15843  * have_step = index.step is not None # <<<<<<<<<<<<<<
15844  *
15845  * slice_memviewslice(
15846  */
15847  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error)
15848  __Pyx_GOTREF(__pyx_t_9);
15849  __pyx_t_1 = (__pyx_t_9 != Py_None);
15850  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15851  __pyx_v_have_step = __pyx_t_1;
15852 
15853  /* "View.MemoryView":768
15854  * have_step = index.step is not None
15855  *
15856  * slice_memviewslice( # <<<<<<<<<<<<<<
15857  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15858  * dim, new_ndim, p_suboffset_dim,
15859  */
15860  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 768, __pyx_L1_error)
15861 
15862  /* "View.MemoryView":774
15863  * have_start, have_stop, have_step,
15864  * True)
15865  * new_ndim += 1 # <<<<<<<<<<<<<<
15866  *
15867  * if isinstance(memview, _memoryviewslice):
15868  */
15869  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15870  }
15871  __pyx_L6:;
15872 
15873  /* "View.MemoryView":746
15874  * cdef bint have_start, have_stop, have_step
15875  *
15876  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15877  * if PyIndex_Check(index):
15878  * slice_memviewslice(
15879  */
15880  }
15881  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15882 
15883  /* "View.MemoryView":776
15884  * new_ndim += 1
15885  *
15886  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15887  * return memoryview_fromslice(dst, new_ndim,
15888  * memviewsliceobj.to_object_func,
15889  */
15890  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15891  __pyx_t_2 = (__pyx_t_1 != 0);
15892  if (__pyx_t_2) {
15893 
15894  /* "View.MemoryView":777
15895  *
15896  * if isinstance(memview, _memoryviewslice):
15897  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15898  * memviewsliceobj.to_object_func,
15899  * memviewsliceobj.to_dtype_func,
15900  */
15901  __Pyx_XDECREF(((PyObject *)__pyx_r));
15902 
15903  /* "View.MemoryView":778
15904  * if isinstance(memview, _memoryviewslice):
15905  * return memoryview_fromslice(dst, new_ndim,
15906  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
15907  * memviewsliceobj.to_dtype_func,
15908  * memview.dtype_is_object)
15909  */
15910  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 778, __pyx_L1_error) }
15911 
15912  /* "View.MemoryView":779
15913  * return memoryview_fromslice(dst, new_ndim,
15914  * memviewsliceobj.to_object_func,
15915  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
15916  * memview.dtype_is_object)
15917  * else:
15918  */
15919  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 779, __pyx_L1_error) }
15920 
15921  /* "View.MemoryView":777
15922  *
15923  * if isinstance(memview, _memoryviewslice):
15924  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15925  * memviewsliceobj.to_object_func,
15926  * memviewsliceobj.to_dtype_func,
15927  */
15928  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 777, __pyx_L1_error)
15929  __Pyx_GOTREF(__pyx_t_3);
15930  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 777, __pyx_L1_error)
15931  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15932  __pyx_t_3 = 0;
15933  goto __pyx_L0;
15934 
15935  /* "View.MemoryView":776
15936  * new_ndim += 1
15937  *
15938  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15939  * return memoryview_fromslice(dst, new_ndim,
15940  * memviewsliceobj.to_object_func,
15941  */
15942  }
15943 
15944  /* "View.MemoryView":782
15945  * memview.dtype_is_object)
15946  * else:
15947  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15948  * memview.dtype_is_object)
15949  *
15950  */
15951  /*else*/ {
15952  __Pyx_XDECREF(((PyObject *)__pyx_r));
15953 
15954  /* "View.MemoryView":783
15955  * else:
15956  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
15957  * memview.dtype_is_object) # <<<<<<<<<<<<<<
15958  *
15959  *
15960  */
15961  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 782, __pyx_L1_error)
15962  __Pyx_GOTREF(__pyx_t_3);
15963 
15964  /* "View.MemoryView":782
15965  * memview.dtype_is_object)
15966  * else:
15967  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15968  * memview.dtype_is_object)
15969  *
15970  */
15971  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 782, __pyx_L1_error)
15972  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15973  __pyx_t_3 = 0;
15974  goto __pyx_L0;
15975  }
15976 
15977  /* "View.MemoryView":710
15978  *
15979  * @cname('__pyx_memview_slice')
15980  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15981  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15982  * cdef bint negative_step
15983  */
15984 
15985  /* function exit code */
15986  __pyx_L1_error:;
15987  __Pyx_XDECREF(__pyx_t_3);
15988  __Pyx_XDECREF(__pyx_t_9);
15989  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15990  __pyx_r = 0;
15991  __pyx_L0:;
15992  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15993  __Pyx_XDECREF(__pyx_v_index);
15994  __Pyx_XGIVEREF((PyObject *)__pyx_r);
15995  __Pyx_RefNannyFinishContext();
15996  return __pyx_r;
15997 }
15998 
15999 /* "View.MemoryView":807
16000  *
16001  * @cname('__pyx_memoryview_slice_memviewslice')
16002  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16003  * __Pyx_memviewslice *dst,
16004  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16005  */
16006 
16007 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
16008  Py_ssize_t __pyx_v_new_shape;
16009  int __pyx_v_negative_step;
16010  int __pyx_r;
16011  int __pyx_t_1;
16012  int __pyx_t_2;
16013  int __pyx_t_3;
16014  int __pyx_lineno = 0;
16015  const char *__pyx_filename = NULL;
16016  int __pyx_clineno = 0;
16017 
16018  /* "View.MemoryView":827
16019  * cdef bint negative_step
16020  *
16021  * if not is_slice: # <<<<<<<<<<<<<<
16022  *
16023  * if start < 0:
16024  */
16025  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16026  if (__pyx_t_1) {
16027 
16028  /* "View.MemoryView":829
16029  * if not is_slice:
16030  *
16031  * if start < 0: # <<<<<<<<<<<<<<
16032  * start += shape
16033  * if not 0 <= start < shape:
16034  */
16035  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16036  if (__pyx_t_1) {
16037 
16038  /* "View.MemoryView":830
16039  *
16040  * if start < 0:
16041  * start += shape # <<<<<<<<<<<<<<
16042  * if not 0 <= start < shape:
16043  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16044  */
16045  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16046 
16047  /* "View.MemoryView":829
16048  * if not is_slice:
16049  *
16050  * if start < 0: # <<<<<<<<<<<<<<
16051  * start += shape
16052  * if not 0 <= start < shape:
16053  */
16054  }
16055 
16056  /* "View.MemoryView":831
16057  * if start < 0:
16058  * start += shape
16059  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16060  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16061  * else:
16062  */
16063  __pyx_t_1 = (0 <= __pyx_v_start);
16064  if (__pyx_t_1) {
16065  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16066  }
16067  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16068  if (__pyx_t_2) {
16069 
16070  /* "View.MemoryView":832
16071  * start += shape
16072  * if not 0 <= start < shape:
16073  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
16074  * else:
16075  *
16076  */
16077  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 832, __pyx_L1_error)
16078 
16079  /* "View.MemoryView":831
16080  * if start < 0:
16081  * start += shape
16082  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16083  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16084  * else:
16085  */
16086  }
16087 
16088  /* "View.MemoryView":827
16089  * cdef bint negative_step
16090  *
16091  * if not is_slice: # <<<<<<<<<<<<<<
16092  *
16093  * if start < 0:
16094  */
16095  goto __pyx_L3;
16096  }
16097 
16098  /* "View.MemoryView":835
16099  * else:
16100  *
16101  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
16102  *
16103  * if have_step and step == 0:
16104  */
16105  /*else*/ {
16106  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16107  if (__pyx_t_1) {
16108  } else {
16109  __pyx_t_2 = __pyx_t_1;
16110  goto __pyx_L6_bool_binop_done;
16111  }
16112  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16113  __pyx_t_2 = __pyx_t_1;
16114  __pyx_L6_bool_binop_done:;
16115  __pyx_v_negative_step = __pyx_t_2;
16116 
16117  /* "View.MemoryView":837
16118  * negative_step = have_step != 0 and step < 0
16119  *
16120  * if have_step and step == 0: # <<<<<<<<<<<<<<
16121  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16122  *
16123  */
16124  __pyx_t_1 = (__pyx_v_have_step != 0);
16125  if (__pyx_t_1) {
16126  } else {
16127  __pyx_t_2 = __pyx_t_1;
16128  goto __pyx_L9_bool_binop_done;
16129  }
16130  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16131  __pyx_t_2 = __pyx_t_1;
16132  __pyx_L9_bool_binop_done:;
16133  if (__pyx_t_2) {
16134 
16135  /* "View.MemoryView":838
16136  *
16137  * if have_step and step == 0:
16138  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
16139  *
16140  *
16141  */
16142  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 838, __pyx_L1_error)
16143 
16144  /* "View.MemoryView":837
16145  * negative_step = have_step != 0 and step < 0
16146  *
16147  * if have_step and step == 0: # <<<<<<<<<<<<<<
16148  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16149  *
16150  */
16151  }
16152 
16153  /* "View.MemoryView":841
16154  *
16155  *
16156  * if have_start: # <<<<<<<<<<<<<<
16157  * if start < 0:
16158  * start += shape
16159  */
16160  __pyx_t_2 = (__pyx_v_have_start != 0);
16161  if (__pyx_t_2) {
16162 
16163  /* "View.MemoryView":842
16164  *
16165  * if have_start:
16166  * if start < 0: # <<<<<<<<<<<<<<
16167  * start += shape
16168  * if start < 0:
16169  */
16170  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16171  if (__pyx_t_2) {
16172 
16173  /* "View.MemoryView":843
16174  * if have_start:
16175  * if start < 0:
16176  * start += shape # <<<<<<<<<<<<<<
16177  * if start < 0:
16178  * start = 0
16179  */
16180  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16181 
16182  /* "View.MemoryView":844
16183  * if start < 0:
16184  * start += shape
16185  * if start < 0: # <<<<<<<<<<<<<<
16186  * start = 0
16187  * elif start >= shape:
16188  */
16189  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16190  if (__pyx_t_2) {
16191 
16192  /* "View.MemoryView":845
16193  * start += shape
16194  * if start < 0:
16195  * start = 0 # <<<<<<<<<<<<<<
16196  * elif start >= shape:
16197  * if negative_step:
16198  */
16199  __pyx_v_start = 0;
16200 
16201  /* "View.MemoryView":844
16202  * if start < 0:
16203  * start += shape
16204  * if start < 0: # <<<<<<<<<<<<<<
16205  * start = 0
16206  * elif start >= shape:
16207  */
16208  }
16209 
16210  /* "View.MemoryView":842
16211  *
16212  * if have_start:
16213  * if start < 0: # <<<<<<<<<<<<<<
16214  * start += shape
16215  * if start < 0:
16216  */
16217  goto __pyx_L12;
16218  }
16219 
16220  /* "View.MemoryView":846
16221  * if start < 0:
16222  * start = 0
16223  * elif start >= shape: # <<<<<<<<<<<<<<
16224  * if negative_step:
16225  * start = shape - 1
16226  */
16227  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16228  if (__pyx_t_2) {
16229 
16230  /* "View.MemoryView":847
16231  * start = 0
16232  * elif start >= shape:
16233  * if negative_step: # <<<<<<<<<<<<<<
16234  * start = shape - 1
16235  * else:
16236  */
16237  __pyx_t_2 = (__pyx_v_negative_step != 0);
16238  if (__pyx_t_2) {
16239 
16240  /* "View.MemoryView":848
16241  * elif start >= shape:
16242  * if negative_step:
16243  * start = shape - 1 # <<<<<<<<<<<<<<
16244  * else:
16245  * start = shape
16246  */
16247  __pyx_v_start = (__pyx_v_shape - 1);
16248 
16249  /* "View.MemoryView":847
16250  * start = 0
16251  * elif start >= shape:
16252  * if negative_step: # <<<<<<<<<<<<<<
16253  * start = shape - 1
16254  * else:
16255  */
16256  goto __pyx_L14;
16257  }
16258 
16259  /* "View.MemoryView":850
16260  * start = shape - 1
16261  * else:
16262  * start = shape # <<<<<<<<<<<<<<
16263  * else:
16264  * if negative_step:
16265  */
16266  /*else*/ {
16267  __pyx_v_start = __pyx_v_shape;
16268  }
16269  __pyx_L14:;
16270 
16271  /* "View.MemoryView":846
16272  * if start < 0:
16273  * start = 0
16274  * elif start >= shape: # <<<<<<<<<<<<<<
16275  * if negative_step:
16276  * start = shape - 1
16277  */
16278  }
16279  __pyx_L12:;
16280 
16281  /* "View.MemoryView":841
16282  *
16283  *
16284  * if have_start: # <<<<<<<<<<<<<<
16285  * if start < 0:
16286  * start += shape
16287  */
16288  goto __pyx_L11;
16289  }
16290 
16291  /* "View.MemoryView":852
16292  * start = shape
16293  * else:
16294  * if negative_step: # <<<<<<<<<<<<<<
16295  * start = shape - 1
16296  * else:
16297  */
16298  /*else*/ {
16299  __pyx_t_2 = (__pyx_v_negative_step != 0);
16300  if (__pyx_t_2) {
16301 
16302  /* "View.MemoryView":853
16303  * else:
16304  * if negative_step:
16305  * start = shape - 1 # <<<<<<<<<<<<<<
16306  * else:
16307  * start = 0
16308  */
16309  __pyx_v_start = (__pyx_v_shape - 1);
16310 
16311  /* "View.MemoryView":852
16312  * start = shape
16313  * else:
16314  * if negative_step: # <<<<<<<<<<<<<<
16315  * start = shape - 1
16316  * else:
16317  */
16318  goto __pyx_L15;
16319  }
16320 
16321  /* "View.MemoryView":855
16322  * start = shape - 1
16323  * else:
16324  * start = 0 # <<<<<<<<<<<<<<
16325  *
16326  * if have_stop:
16327  */
16328  /*else*/ {
16329  __pyx_v_start = 0;
16330  }
16331  __pyx_L15:;
16332  }
16333  __pyx_L11:;
16334 
16335  /* "View.MemoryView":857
16336  * start = 0
16337  *
16338  * if have_stop: # <<<<<<<<<<<<<<
16339  * if stop < 0:
16340  * stop += shape
16341  */
16342  __pyx_t_2 = (__pyx_v_have_stop != 0);
16343  if (__pyx_t_2) {
16344 
16345  /* "View.MemoryView":858
16346  *
16347  * if have_stop:
16348  * if stop < 0: # <<<<<<<<<<<<<<
16349  * stop += shape
16350  * if stop < 0:
16351  */
16352  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16353  if (__pyx_t_2) {
16354 
16355  /* "View.MemoryView":859
16356  * if have_stop:
16357  * if stop < 0:
16358  * stop += shape # <<<<<<<<<<<<<<
16359  * if stop < 0:
16360  * stop = 0
16361  */
16362  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16363 
16364  /* "View.MemoryView":860
16365  * if stop < 0:
16366  * stop += shape
16367  * if stop < 0: # <<<<<<<<<<<<<<
16368  * stop = 0
16369  * elif stop > shape:
16370  */
16371  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16372  if (__pyx_t_2) {
16373 
16374  /* "View.MemoryView":861
16375  * stop += shape
16376  * if stop < 0:
16377  * stop = 0 # <<<<<<<<<<<<<<
16378  * elif stop > shape:
16379  * stop = shape
16380  */
16381  __pyx_v_stop = 0;
16382 
16383  /* "View.MemoryView":860
16384  * if stop < 0:
16385  * stop += shape
16386  * if stop < 0: # <<<<<<<<<<<<<<
16387  * stop = 0
16388  * elif stop > shape:
16389  */
16390  }
16391 
16392  /* "View.MemoryView":858
16393  *
16394  * if have_stop:
16395  * if stop < 0: # <<<<<<<<<<<<<<
16396  * stop += shape
16397  * if stop < 0:
16398  */
16399  goto __pyx_L17;
16400  }
16401 
16402  /* "View.MemoryView":862
16403  * if stop < 0:
16404  * stop = 0
16405  * elif stop > shape: # <<<<<<<<<<<<<<
16406  * stop = shape
16407  * else:
16408  */
16409  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16410  if (__pyx_t_2) {
16411 
16412  /* "View.MemoryView":863
16413  * stop = 0
16414  * elif stop > shape:
16415  * stop = shape # <<<<<<<<<<<<<<
16416  * else:
16417  * if negative_step:
16418  */
16419  __pyx_v_stop = __pyx_v_shape;
16420 
16421  /* "View.MemoryView":862
16422  * if stop < 0:
16423  * stop = 0
16424  * elif stop > shape: # <<<<<<<<<<<<<<
16425  * stop = shape
16426  * else:
16427  */
16428  }
16429  __pyx_L17:;
16430 
16431  /* "View.MemoryView":857
16432  * start = 0
16433  *
16434  * if have_stop: # <<<<<<<<<<<<<<
16435  * if stop < 0:
16436  * stop += shape
16437  */
16438  goto __pyx_L16;
16439  }
16440 
16441  /* "View.MemoryView":865
16442  * stop = shape
16443  * else:
16444  * if negative_step: # <<<<<<<<<<<<<<
16445  * stop = -1
16446  * else:
16447  */
16448  /*else*/ {
16449  __pyx_t_2 = (__pyx_v_negative_step != 0);
16450  if (__pyx_t_2) {
16451 
16452  /* "View.MemoryView":866
16453  * else:
16454  * if negative_step:
16455  * stop = -1 # <<<<<<<<<<<<<<
16456  * else:
16457  * stop = shape
16458  */
16459  __pyx_v_stop = -1L;
16460 
16461  /* "View.MemoryView":865
16462  * stop = shape
16463  * else:
16464  * if negative_step: # <<<<<<<<<<<<<<
16465  * stop = -1
16466  * else:
16467  */
16468  goto __pyx_L19;
16469  }
16470 
16471  /* "View.MemoryView":868
16472  * stop = -1
16473  * else:
16474  * stop = shape # <<<<<<<<<<<<<<
16475  *
16476  * if not have_step:
16477  */
16478  /*else*/ {
16479  __pyx_v_stop = __pyx_v_shape;
16480  }
16481  __pyx_L19:;
16482  }
16483  __pyx_L16:;
16484 
16485  /* "View.MemoryView":870
16486  * stop = shape
16487  *
16488  * if not have_step: # <<<<<<<<<<<<<<
16489  * step = 1
16490  *
16491  */
16492  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16493  if (__pyx_t_2) {
16494 
16495  /* "View.MemoryView":871
16496  *
16497  * if not have_step:
16498  * step = 1 # <<<<<<<<<<<<<<
16499  *
16500  *
16501  */
16502  __pyx_v_step = 1;
16503 
16504  /* "View.MemoryView":870
16505  * stop = shape
16506  *
16507  * if not have_step: # <<<<<<<<<<<<<<
16508  * step = 1
16509  *
16510  */
16511  }
16512 
16513  /* "View.MemoryView":875
16514  *
16515  * with cython.cdivision(True):
16516  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
16517  *
16518  * if (stop - start) - step * new_shape:
16519  */
16520  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16521 
16522  /* "View.MemoryView":877
16523  * new_shape = (stop - start) // step
16524  *
16525  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16526  * new_shape += 1
16527  *
16528  */
16529  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16530  if (__pyx_t_2) {
16531 
16532  /* "View.MemoryView":878
16533  *
16534  * if (stop - start) - step * new_shape:
16535  * new_shape += 1 # <<<<<<<<<<<<<<
16536  *
16537  * if new_shape < 0:
16538  */
16539  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16540 
16541  /* "View.MemoryView":877
16542  * new_shape = (stop - start) // step
16543  *
16544  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16545  * new_shape += 1
16546  *
16547  */
16548  }
16549 
16550  /* "View.MemoryView":880
16551  * new_shape += 1
16552  *
16553  * if new_shape < 0: # <<<<<<<<<<<<<<
16554  * new_shape = 0
16555  *
16556  */
16557  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16558  if (__pyx_t_2) {
16559 
16560  /* "View.MemoryView":881
16561  *
16562  * if new_shape < 0:
16563  * new_shape = 0 # <<<<<<<<<<<<<<
16564  *
16565  *
16566  */
16567  __pyx_v_new_shape = 0;
16568 
16569  /* "View.MemoryView":880
16570  * new_shape += 1
16571  *
16572  * if new_shape < 0: # <<<<<<<<<<<<<<
16573  * new_shape = 0
16574  *
16575  */
16576  }
16577 
16578  /* "View.MemoryView":884
16579  *
16580  *
16581  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
16582  * dst.shape[new_ndim] = new_shape
16583  * dst.suboffsets[new_ndim] = suboffset
16584  */
16585  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16586 
16587  /* "View.MemoryView":885
16588  *
16589  * dst.strides[new_ndim] = stride * step
16590  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
16591  * dst.suboffsets[new_ndim] = suboffset
16592  *
16593  */
16594  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16595 
16596  /* "View.MemoryView":886
16597  * dst.strides[new_ndim] = stride * step
16598  * dst.shape[new_ndim] = new_shape
16599  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
16600  *
16601  *
16602  */
16603  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16604  }
16605  __pyx_L3:;
16606 
16607  /* "View.MemoryView":889
16608  *
16609  *
16610  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16611  * dst.data += start * stride
16612  * else:
16613  */
16614  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16615  if (__pyx_t_2) {
16616 
16617  /* "View.MemoryView":890
16618  *
16619  * if suboffset_dim[0] < 0:
16620  * dst.data += start * stride # <<<<<<<<<<<<<<
16621  * else:
16622  * dst.suboffsets[suboffset_dim[0]] += start * stride
16623  */
16624  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16625 
16626  /* "View.MemoryView":889
16627  *
16628  *
16629  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16630  * dst.data += start * stride
16631  * else:
16632  */
16633  goto __pyx_L23;
16634  }
16635 
16636  /* "View.MemoryView":892
16637  * dst.data += start * stride
16638  * else:
16639  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
16640  *
16641  * if suboffset >= 0:
16642  */
16643  /*else*/ {
16644  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16645  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16646  }
16647  __pyx_L23:;
16648 
16649  /* "View.MemoryView":894
16650  * dst.suboffsets[suboffset_dim[0]] += start * stride
16651  *
16652  * if suboffset >= 0: # <<<<<<<<<<<<<<
16653  * if not is_slice:
16654  * if new_ndim == 0:
16655  */
16656  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16657  if (__pyx_t_2) {
16658 
16659  /* "View.MemoryView":895
16660  *
16661  * if suboffset >= 0:
16662  * if not is_slice: # <<<<<<<<<<<<<<
16663  * if new_ndim == 0:
16664  * dst.data = (<char **> dst.data)[0] + suboffset
16665  */
16666  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16667  if (__pyx_t_2) {
16668 
16669  /* "View.MemoryView":896
16670  * if suboffset >= 0:
16671  * if not is_slice:
16672  * if new_ndim == 0: # <<<<<<<<<<<<<<
16673  * dst.data = (<char **> dst.data)[0] + suboffset
16674  * else:
16675  */
16676  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16677  if (__pyx_t_2) {
16678 
16679  /* "View.MemoryView":897
16680  * if not is_slice:
16681  * if new_ndim == 0:
16682  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
16683  * else:
16684  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16685  */
16686  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16687 
16688  /* "View.MemoryView":896
16689  * if suboffset >= 0:
16690  * if not is_slice:
16691  * if new_ndim == 0: # <<<<<<<<<<<<<<
16692  * dst.data = (<char **> dst.data)[0] + suboffset
16693  * else:
16694  */
16695  goto __pyx_L26;
16696  }
16697 
16698  /* "View.MemoryView":899
16699  * dst.data = (<char **> dst.data)[0] + suboffset
16700  * else:
16701  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
16702  * "must be indexed and not sliced", dim)
16703  * else:
16704  */
16705  /*else*/ {
16706 
16707  /* "View.MemoryView":900
16708  * else:
16709  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16710  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
16711  * else:
16712  * suboffset_dim[0] = new_ndim
16713  */
16714  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 899, __pyx_L1_error)
16715  }
16716  __pyx_L26:;
16717 
16718  /* "View.MemoryView":895
16719  *
16720  * if suboffset >= 0:
16721  * if not is_slice: # <<<<<<<<<<<<<<
16722  * if new_ndim == 0:
16723  * dst.data = (<char **> dst.data)[0] + suboffset
16724  */
16725  goto __pyx_L25;
16726  }
16727 
16728  /* "View.MemoryView":902
16729  * "must be indexed and not sliced", dim)
16730  * else:
16731  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
16732  *
16733  * return 0
16734  */
16735  /*else*/ {
16736  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16737  }
16738  __pyx_L25:;
16739 
16740  /* "View.MemoryView":894
16741  * dst.suboffsets[suboffset_dim[0]] += start * stride
16742  *
16743  * if suboffset >= 0: # <<<<<<<<<<<<<<
16744  * if not is_slice:
16745  * if new_ndim == 0:
16746  */
16747  }
16748 
16749  /* "View.MemoryView":904
16750  * suboffset_dim[0] = new_ndim
16751  *
16752  * return 0 # <<<<<<<<<<<<<<
16753  *
16754  *
16755  */
16756  __pyx_r = 0;
16757  goto __pyx_L0;
16758 
16759  /* "View.MemoryView":807
16760  *
16761  * @cname('__pyx_memoryview_slice_memviewslice')
16762  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16763  * __Pyx_memviewslice *dst,
16764  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16765  */
16766 
16767  /* function exit code */
16768  __pyx_L1_error:;
16769  {
16770  #ifdef WITH_THREAD
16771  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16772  #endif
16773  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16774  #ifdef WITH_THREAD
16775  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16776  #endif
16777  }
16778  __pyx_r = -1;
16779  __pyx_L0:;
16780  return __pyx_r;
16781 }
16782 
16783 /* "View.MemoryView":910
16784  *
16785  * @cname('__pyx_pybuffer_index')
16786  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16787  * Py_ssize_t dim) except NULL:
16788  * cdef Py_ssize_t shape, stride, suboffset = -1
16789  */
16790 
16791 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16792  Py_ssize_t __pyx_v_shape;
16793  Py_ssize_t __pyx_v_stride;
16794  Py_ssize_t __pyx_v_suboffset;
16795  Py_ssize_t __pyx_v_itemsize;
16796  char *__pyx_v_resultp;
16797  char *__pyx_r;
16798  __Pyx_RefNannyDeclarations
16799  Py_ssize_t __pyx_t_1;
16800  int __pyx_t_2;
16801  PyObject *__pyx_t_3 = NULL;
16802  PyObject *__pyx_t_4 = NULL;
16803  int __pyx_lineno = 0;
16804  const char *__pyx_filename = NULL;
16805  int __pyx_clineno = 0;
16806  __Pyx_RefNannySetupContext("pybuffer_index", 0);
16807 
16808  /* "View.MemoryView":912
16809  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
16810  * Py_ssize_t dim) except NULL:
16811  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
16812  * cdef Py_ssize_t itemsize = view.itemsize
16813  * cdef char *resultp
16814  */
16815  __pyx_v_suboffset = -1L;
16816 
16817  /* "View.MemoryView":913
16818  * Py_ssize_t dim) except NULL:
16819  * cdef Py_ssize_t shape, stride, suboffset = -1
16820  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
16821  * cdef char *resultp
16822  *
16823  */
16824  __pyx_t_1 = __pyx_v_view->itemsize;
16825  __pyx_v_itemsize = __pyx_t_1;
16826 
16827  /* "View.MemoryView":916
16828  * cdef char *resultp
16829  *
16830  * if view.ndim == 0: # <<<<<<<<<<<<<<
16831  * shape = view.len / itemsize
16832  * stride = itemsize
16833  */
16834  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16835  if (__pyx_t_2) {
16836 
16837  /* "View.MemoryView":917
16838  *
16839  * if view.ndim == 0:
16840  * shape = view.len / itemsize # <<<<<<<<<<<<<<
16841  * stride = itemsize
16842  * else:
16843  */
16844  if (unlikely(__pyx_v_itemsize == 0)) {
16845  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
16846  __PYX_ERR(2, 917, __pyx_L1_error)
16847  }
16848  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16849  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
16850  __PYX_ERR(2, 917, __pyx_L1_error)
16851  }
16852  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16853 
16854  /* "View.MemoryView":918
16855  * if view.ndim == 0:
16856  * shape = view.len / itemsize
16857  * stride = itemsize # <<<<<<<<<<<<<<
16858  * else:
16859  * shape = view.shape[dim]
16860  */
16861  __pyx_v_stride = __pyx_v_itemsize;
16862 
16863  /* "View.MemoryView":916
16864  * cdef char *resultp
16865  *
16866  * if view.ndim == 0: # <<<<<<<<<<<<<<
16867  * shape = view.len / itemsize
16868  * stride = itemsize
16869  */
16870  goto __pyx_L3;
16871  }
16872 
16873  /* "View.MemoryView":920
16874  * stride = itemsize
16875  * else:
16876  * shape = view.shape[dim] # <<<<<<<<<<<<<<
16877  * stride = view.strides[dim]
16878  * if view.suboffsets != NULL:
16879  */
16880  /*else*/ {
16881  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16882 
16883  /* "View.MemoryView":921
16884  * else:
16885  * shape = view.shape[dim]
16886  * stride = view.strides[dim] # <<<<<<<<<<<<<<
16887  * if view.suboffsets != NULL:
16888  * suboffset = view.suboffsets[dim]
16889  */
16890  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16891 
16892  /* "View.MemoryView":922
16893  * shape = view.shape[dim]
16894  * stride = view.strides[dim]
16895  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16896  * suboffset = view.suboffsets[dim]
16897  *
16898  */
16899  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16900  if (__pyx_t_2) {
16901 
16902  /* "View.MemoryView":923
16903  * stride = view.strides[dim]
16904  * if view.suboffsets != NULL:
16905  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
16906  *
16907  * if index < 0:
16908  */
16909  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16910 
16911  /* "View.MemoryView":922
16912  * shape = view.shape[dim]
16913  * stride = view.strides[dim]
16914  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16915  * suboffset = view.suboffsets[dim]
16916  *
16917  */
16918  }
16919  }
16920  __pyx_L3:;
16921 
16922  /* "View.MemoryView":925
16923  * suboffset = view.suboffsets[dim]
16924  *
16925  * if index < 0: # <<<<<<<<<<<<<<
16926  * index += view.shape[dim]
16927  * if index < 0:
16928  */
16929  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16930  if (__pyx_t_2) {
16931 
16932  /* "View.MemoryView":926
16933  *
16934  * if index < 0:
16935  * index += view.shape[dim] # <<<<<<<<<<<<<<
16936  * if index < 0:
16937  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16938  */
16939  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16940 
16941  /* "View.MemoryView":927
16942  * if index < 0:
16943  * index += view.shape[dim]
16944  * if index < 0: # <<<<<<<<<<<<<<
16945  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16946  *
16947  */
16948  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16949  if (unlikely(__pyx_t_2)) {
16950 
16951  /* "View.MemoryView":928
16952  * index += view.shape[dim]
16953  * if index < 0:
16954  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16955  *
16956  * if index >= shape:
16957  */
16958  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
16959  __Pyx_GOTREF(__pyx_t_3);
16960  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 928, __pyx_L1_error)
16961  __Pyx_GOTREF(__pyx_t_4);
16962  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16963  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
16964  __Pyx_GOTREF(__pyx_t_3);
16965  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16966  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16967  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16968  __PYX_ERR(2, 928, __pyx_L1_error)
16969 
16970  /* "View.MemoryView":927
16971  * if index < 0:
16972  * index += view.shape[dim]
16973  * if index < 0: # <<<<<<<<<<<<<<
16974  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16975  *
16976  */
16977  }
16978 
16979  /* "View.MemoryView":925
16980  * suboffset = view.suboffsets[dim]
16981  *
16982  * if index < 0: # <<<<<<<<<<<<<<
16983  * index += view.shape[dim]
16984  * if index < 0:
16985  */
16986  }
16987 
16988  /* "View.MemoryView":930
16989  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16990  *
16991  * if index >= shape: # <<<<<<<<<<<<<<
16992  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16993  *
16994  */
16995  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16996  if (unlikely(__pyx_t_2)) {
16997 
16998  /* "View.MemoryView":931
16999  *
17000  * if index >= shape:
17001  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17002  *
17003  * resultp = bufp + index * stride
17004  */
17005  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
17006  __Pyx_GOTREF(__pyx_t_3);
17007  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 931, __pyx_L1_error)
17008  __Pyx_GOTREF(__pyx_t_4);
17009  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17010  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
17011  __Pyx_GOTREF(__pyx_t_3);
17012  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17013  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17014  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17015  __PYX_ERR(2, 931, __pyx_L1_error)
17016 
17017  /* "View.MemoryView":930
17018  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17019  *
17020  * if index >= shape: # <<<<<<<<<<<<<<
17021  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17022  *
17023  */
17024  }
17025 
17026  /* "View.MemoryView":933
17027  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17028  *
17029  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
17030  * if suboffset >= 0:
17031  * resultp = (<char **> resultp)[0] + suboffset
17032  */
17033  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17034 
17035  /* "View.MemoryView":934
17036  *
17037  * resultp = bufp + index * stride
17038  * if suboffset >= 0: # <<<<<<<<<<<<<<
17039  * resultp = (<char **> resultp)[0] + suboffset
17040  *
17041  */
17042  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17043  if (__pyx_t_2) {
17044 
17045  /* "View.MemoryView":935
17046  * resultp = bufp + index * stride
17047  * if suboffset >= 0:
17048  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
17049  *
17050  * return resultp
17051  */
17052  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17053 
17054  /* "View.MemoryView":934
17055  *
17056  * resultp = bufp + index * stride
17057  * if suboffset >= 0: # <<<<<<<<<<<<<<
17058  * resultp = (<char **> resultp)[0] + suboffset
17059  *
17060  */
17061  }
17062 
17063  /* "View.MemoryView":937
17064  * resultp = (<char **> resultp)[0] + suboffset
17065  *
17066  * return resultp # <<<<<<<<<<<<<<
17067  *
17068  *
17069  */
17070  __pyx_r = __pyx_v_resultp;
17071  goto __pyx_L0;
17072 
17073  /* "View.MemoryView":910
17074  *
17075  * @cname('__pyx_pybuffer_index')
17076  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17077  * Py_ssize_t dim) except NULL:
17078  * cdef Py_ssize_t shape, stride, suboffset = -1
17079  */
17080 
17081  /* function exit code */
17082  __pyx_L1_error:;
17083  __Pyx_XDECREF(__pyx_t_3);
17084  __Pyx_XDECREF(__pyx_t_4);
17085  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17086  __pyx_r = NULL;
17087  __pyx_L0:;
17088  __Pyx_RefNannyFinishContext();
17089  return __pyx_r;
17090 }
17091 
17092 /* "View.MemoryView":943
17093  *
17094  * @cname('__pyx_memslice_transpose')
17095  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17096  * cdef int ndim = memslice.memview.view.ndim
17097  *
17098  */
17099 
17100 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17101  int __pyx_v_ndim;
17102  Py_ssize_t *__pyx_v_shape;
17103  Py_ssize_t *__pyx_v_strides;
17104  int __pyx_v_i;
17105  int __pyx_v_j;
17106  int __pyx_r;
17107  int __pyx_t_1;
17108  Py_ssize_t *__pyx_t_2;
17109  long __pyx_t_3;
17110  long __pyx_t_4;
17111  Py_ssize_t __pyx_t_5;
17112  Py_ssize_t __pyx_t_6;
17113  int __pyx_t_7;
17114  int __pyx_t_8;
17115  int __pyx_t_9;
17116  int __pyx_lineno = 0;
17117  const char *__pyx_filename = NULL;
17118  int __pyx_clineno = 0;
17119 
17120  /* "View.MemoryView":944
17121  * @cname('__pyx_memslice_transpose')
17122  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
17123  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
17124  *
17125  * cdef Py_ssize_t *shape = memslice.shape
17126  */
17127  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17128  __pyx_v_ndim = __pyx_t_1;
17129 
17130  /* "View.MemoryView":946
17131  * cdef int ndim = memslice.memview.view.ndim
17132  *
17133  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
17134  * cdef Py_ssize_t *strides = memslice.strides
17135  *
17136  */
17137  __pyx_t_2 = __pyx_v_memslice->shape;
17138  __pyx_v_shape = __pyx_t_2;
17139 
17140  /* "View.MemoryView":947
17141  *
17142  * cdef Py_ssize_t *shape = memslice.shape
17143  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
17144  *
17145  *
17146  */
17147  __pyx_t_2 = __pyx_v_memslice->strides;
17148  __pyx_v_strides = __pyx_t_2;
17149 
17150  /* "View.MemoryView":951
17151  *
17152  * cdef int i, j
17153  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
17154  * j = ndim - 1 - i
17155  * strides[i], strides[j] = strides[j], strides[i]
17156  */
17157  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17158  __pyx_t_4 = __pyx_t_3;
17159  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17160  __pyx_v_i = __pyx_t_1;
17161 
17162  /* "View.MemoryView":952
17163  * cdef int i, j
17164  * for i in range(ndim / 2):
17165  * j = ndim - 1 - i # <<<<<<<<<<<<<<
17166  * strides[i], strides[j] = strides[j], strides[i]
17167  * shape[i], shape[j] = shape[j], shape[i]
17168  */
17169  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17170 
17171  /* "View.MemoryView":953
17172  * for i in range(ndim / 2):
17173  * j = ndim - 1 - i
17174  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
17175  * shape[i], shape[j] = shape[j], shape[i]
17176  *
17177  */
17178  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17179  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17180  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17181  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17182 
17183  /* "View.MemoryView":954
17184  * j = ndim - 1 - i
17185  * strides[i], strides[j] = strides[j], strides[i]
17186  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
17187  *
17188  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17189  */
17190  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17191  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17192  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17193  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17194 
17195  /* "View.MemoryView":956
17196  * shape[i], shape[j] = shape[j], shape[i]
17197  *
17198  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17199  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17200  *
17201  */
17202  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17203  if (!__pyx_t_8) {
17204  } else {
17205  __pyx_t_7 = __pyx_t_8;
17206  goto __pyx_L6_bool_binop_done;
17207  }
17208  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17209  __pyx_t_7 = __pyx_t_8;
17210  __pyx_L6_bool_binop_done:;
17211  if (__pyx_t_7) {
17212 
17213  /* "View.MemoryView":957
17214  *
17215  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17216  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
17217  *
17218  * return 1
17219  */
17220  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L1_error)
17221 
17222  /* "View.MemoryView":956
17223  * shape[i], shape[j] = shape[j], shape[i]
17224  *
17225  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17226  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17227  *
17228  */
17229  }
17230  }
17231 
17232  /* "View.MemoryView":959
17233  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17234  *
17235  * return 1 # <<<<<<<<<<<<<<
17236  *
17237  *
17238  */
17239  __pyx_r = 1;
17240  goto __pyx_L0;
17241 
17242  /* "View.MemoryView":943
17243  *
17244  * @cname('__pyx_memslice_transpose')
17245  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17246  * cdef int ndim = memslice.memview.view.ndim
17247  *
17248  */
17249 
17250  /* function exit code */
17251  __pyx_L1_error:;
17252  {
17253  #ifdef WITH_THREAD
17254  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17255  #endif
17256  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17257  #ifdef WITH_THREAD
17258  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17259  #endif
17260  }
17261  __pyx_r = 0;
17262  __pyx_L0:;
17263  return __pyx_r;
17264 }
17265 
17266 /* "View.MemoryView":976
17267  * cdef int (*to_dtype_func)(char *, object) except 0
17268  *
17269  * def __dealloc__(self): # <<<<<<<<<<<<<<
17270  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17271  *
17272  */
17273 
17274 /* Python wrapper */
17275 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
17276 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17277  __Pyx_RefNannyDeclarations
17278  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
17279  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17280 
17281  /* function exit code */
17282  __Pyx_RefNannyFinishContext();
17283 }
17284 
17285 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17286  __Pyx_RefNannyDeclarations
17287  __Pyx_RefNannySetupContext("__dealloc__", 0);
17288 
17289  /* "View.MemoryView":977
17290  *
17291  * def __dealloc__(self):
17292  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
17293  *
17294  * cdef convert_item_to_object(self, char *itemp):
17295  */
17296  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17297 
17298  /* "View.MemoryView":976
17299  * cdef int (*to_dtype_func)(char *, object) except 0
17300  *
17301  * def __dealloc__(self): # <<<<<<<<<<<<<<
17302  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17303  *
17304  */
17305 
17306  /* function exit code */
17307  __Pyx_RefNannyFinishContext();
17308 }
17309 
17310 /* "View.MemoryView":979
17311  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17312  *
17313  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17314  * if self.to_object_func != NULL:
17315  * return self.to_object_func(itemp)
17316  */
17317 
17318 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
17319  PyObject *__pyx_r = NULL;
17320  __Pyx_RefNannyDeclarations
17321  int __pyx_t_1;
17322  PyObject *__pyx_t_2 = NULL;
17323  int __pyx_lineno = 0;
17324  const char *__pyx_filename = NULL;
17325  int __pyx_clineno = 0;
17326  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
17327 
17328  /* "View.MemoryView":980
17329  *
17330  * cdef convert_item_to_object(self, char *itemp):
17331  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17332  * return self.to_object_func(itemp)
17333  * else:
17334  */
17335  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17336  if (__pyx_t_1) {
17337 
17338  /* "View.MemoryView":981
17339  * cdef convert_item_to_object(self, char *itemp):
17340  * if self.to_object_func != NULL:
17341  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
17342  * else:
17343  * return memoryview.convert_item_to_object(self, itemp)
17344  */
17345  __Pyx_XDECREF(__pyx_r);
17346  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 981, __pyx_L1_error)
17347  __Pyx_GOTREF(__pyx_t_2);
17348  __pyx_r = __pyx_t_2;
17349  __pyx_t_2 = 0;
17350  goto __pyx_L0;
17351 
17352  /* "View.MemoryView":980
17353  *
17354  * cdef convert_item_to_object(self, char *itemp):
17355  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17356  * return self.to_object_func(itemp)
17357  * else:
17358  */
17359  }
17360 
17361  /* "View.MemoryView":983
17362  * return self.to_object_func(itemp)
17363  * else:
17364  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
17365  *
17366  * cdef assign_item_from_object(self, char *itemp, object value):
17367  */
17368  /*else*/ {
17369  __Pyx_XDECREF(__pyx_r);
17370  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error)
17371  __Pyx_GOTREF(__pyx_t_2);
17372  __pyx_r = __pyx_t_2;
17373  __pyx_t_2 = 0;
17374  goto __pyx_L0;
17375  }
17376 
17377  /* "View.MemoryView":979
17378  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17379  *
17380  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17381  * if self.to_object_func != NULL:
17382  * return self.to_object_func(itemp)
17383  */
17384 
17385  /* function exit code */
17386  __pyx_L1_error:;
17387  __Pyx_XDECREF(__pyx_t_2);
17388  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17389  __pyx_r = 0;
17390  __pyx_L0:;
17391  __Pyx_XGIVEREF(__pyx_r);
17392  __Pyx_RefNannyFinishContext();
17393  return __pyx_r;
17394 }
17395 
17396 /* "View.MemoryView":985
17397  * return memoryview.convert_item_to_object(self, itemp)
17398  *
17399  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17400  * if self.to_dtype_func != NULL:
17401  * self.to_dtype_func(itemp, value)
17402  */
17403 
17404 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17405  PyObject *__pyx_r = NULL;
17406  __Pyx_RefNannyDeclarations
17407  int __pyx_t_1;
17408  int __pyx_t_2;
17409  PyObject *__pyx_t_3 = NULL;
17410  int __pyx_lineno = 0;
17411  const char *__pyx_filename = NULL;
17412  int __pyx_clineno = 0;
17413  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
17414 
17415  /* "View.MemoryView":986
17416  *
17417  * cdef assign_item_from_object(self, char *itemp, object value):
17418  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17419  * self.to_dtype_func(itemp, value)
17420  * else:
17421  */
17422  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17423  if (__pyx_t_1) {
17424 
17425  /* "View.MemoryView":987
17426  * cdef assign_item_from_object(self, char *itemp, object value):
17427  * if self.to_dtype_func != NULL:
17428  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
17429  * else:
17430  * memoryview.assign_item_from_object(self, itemp, value)
17431  */
17432  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 987, __pyx_L1_error)
17433 
17434  /* "View.MemoryView":986
17435  *
17436  * cdef assign_item_from_object(self, char *itemp, object value):
17437  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17438  * self.to_dtype_func(itemp, value)
17439  * else:
17440  */
17441  goto __pyx_L3;
17442  }
17443 
17444  /* "View.MemoryView":989
17445  * self.to_dtype_func(itemp, value)
17446  * else:
17447  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
17448  *
17449  * @property
17450  */
17451  /*else*/ {
17452  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 989, __pyx_L1_error)
17453  __Pyx_GOTREF(__pyx_t_3);
17454  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17455  }
17456  __pyx_L3:;
17457 
17458  /* "View.MemoryView":985
17459  * return memoryview.convert_item_to_object(self, itemp)
17460  *
17461  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17462  * if self.to_dtype_func != NULL:
17463  * self.to_dtype_func(itemp, value)
17464  */
17465 
17466  /* function exit code */
17467  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17468  goto __pyx_L0;
17469  __pyx_L1_error:;
17470  __Pyx_XDECREF(__pyx_t_3);
17471  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17472  __pyx_r = 0;
17473  __pyx_L0:;
17474  __Pyx_XGIVEREF(__pyx_r);
17475  __Pyx_RefNannyFinishContext();
17476  return __pyx_r;
17477 }
17478 
17479 /* "View.MemoryView":992
17480  *
17481  * @property
17482  * def base(self): # <<<<<<<<<<<<<<
17483  * return self.from_object
17484  *
17485  */
17486 
17487 /* Python wrapper */
17488 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
17489 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17490  PyObject *__pyx_r = 0;
17491  __Pyx_RefNannyDeclarations
17492  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17493  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17494 
17495  /* function exit code */
17496  __Pyx_RefNannyFinishContext();
17497  return __pyx_r;
17498 }
17499 
17500 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17501  PyObject *__pyx_r = NULL;
17502  __Pyx_RefNannyDeclarations
17503  __Pyx_RefNannySetupContext("__get__", 0);
17504 
17505  /* "View.MemoryView":993
17506  * @property
17507  * def base(self):
17508  * return self.from_object # <<<<<<<<<<<<<<
17509  *
17510  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
17511  */
17512  __Pyx_XDECREF(__pyx_r);
17513  __Pyx_INCREF(__pyx_v_self->from_object);
17514  __pyx_r = __pyx_v_self->from_object;
17515  goto __pyx_L0;
17516 
17517  /* "View.MemoryView":992
17518  *
17519  * @property
17520  * def base(self): # <<<<<<<<<<<<<<
17521  * return self.from_object
17522  *
17523  */
17524 
17525  /* function exit code */
17526  __pyx_L0:;
17527  __Pyx_XGIVEREF(__pyx_r);
17528  __Pyx_RefNannyFinishContext();
17529  return __pyx_r;
17530 }
17531 
17532 /* "(tree fragment)":1
17533  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17534  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17535  * def __setstate_cython__(self, __pyx_state):
17536  */
17537 
17538 /* Python wrapper */
17539 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17540 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17541  PyObject *__pyx_r = 0;
17542  __Pyx_RefNannyDeclarations
17543  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17544  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17545 
17546  /* function exit code */
17547  __Pyx_RefNannyFinishContext();
17548  return __pyx_r;
17549 }
17550 
17551 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17552  PyObject *__pyx_r = NULL;
17553  __Pyx_RefNannyDeclarations
17554  PyObject *__pyx_t_1 = NULL;
17555  int __pyx_lineno = 0;
17556  const char *__pyx_filename = NULL;
17557  int __pyx_clineno = 0;
17558  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17559 
17560  /* "(tree fragment)":2
17561  * def __reduce_cython__(self):
17562  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17563  * def __setstate_cython__(self, __pyx_state):
17564  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17565  */
17566  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
17567  __Pyx_GOTREF(__pyx_t_1);
17568  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17569  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17570  __PYX_ERR(2, 2, __pyx_L1_error)
17571 
17572  /* "(tree fragment)":1
17573  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17574  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17575  * def __setstate_cython__(self, __pyx_state):
17576  */
17577 
17578  /* function exit code */
17579  __pyx_L1_error:;
17580  __Pyx_XDECREF(__pyx_t_1);
17581  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17582  __pyx_r = NULL;
17583  __Pyx_XGIVEREF(__pyx_r);
17584  __Pyx_RefNannyFinishContext();
17585  return __pyx_r;
17586 }
17587 
17588 /* "(tree fragment)":3
17589  * def __reduce_cython__(self):
17590  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17591  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17592  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17593  */
17594 
17595 /* Python wrapper */
17596 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
17597 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17598  PyObject *__pyx_r = 0;
17599  __Pyx_RefNannyDeclarations
17600  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17601  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17602 
17603  /* function exit code */
17604  __Pyx_RefNannyFinishContext();
17605  return __pyx_r;
17606 }
17607 
17608 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17609  PyObject *__pyx_r = NULL;
17610  __Pyx_RefNannyDeclarations
17611  PyObject *__pyx_t_1 = NULL;
17612  int __pyx_lineno = 0;
17613  const char *__pyx_filename = NULL;
17614  int __pyx_clineno = 0;
17615  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17616 
17617  /* "(tree fragment)":4
17618  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17619  * def __setstate_cython__(self, __pyx_state):
17620  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17621  */
17622  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
17623  __Pyx_GOTREF(__pyx_t_1);
17624  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17625  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17626  __PYX_ERR(2, 4, __pyx_L1_error)
17627 
17628  /* "(tree fragment)":3
17629  * def __reduce_cython__(self):
17630  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17631  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17632  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17633  */
17634 
17635  /* function exit code */
17636  __pyx_L1_error:;
17637  __Pyx_XDECREF(__pyx_t_1);
17638  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17639  __pyx_r = NULL;
17640  __Pyx_XGIVEREF(__pyx_r);
17641  __Pyx_RefNannyFinishContext();
17642  return __pyx_r;
17643 }
17644 
17645 /* "View.MemoryView":999
17646  *
17647  * @cname('__pyx_memoryview_fromslice')
17648  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17649  * int ndim,
17650  * object (*to_object_func)(char *),
17651  */
17652 
17653 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
17654  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17655  Py_ssize_t __pyx_v_suboffset;
17656  PyObject *__pyx_v_length = NULL;
17657  PyObject *__pyx_r = NULL;
17658  __Pyx_RefNannyDeclarations
17659  int __pyx_t_1;
17660  PyObject *__pyx_t_2 = NULL;
17661  PyObject *__pyx_t_3 = NULL;
17662  __Pyx_TypeInfo *__pyx_t_4;
17663  Py_buffer __pyx_t_5;
17664  Py_ssize_t *__pyx_t_6;
17665  Py_ssize_t *__pyx_t_7;
17666  Py_ssize_t *__pyx_t_8;
17667  Py_ssize_t __pyx_t_9;
17668  int __pyx_lineno = 0;
17669  const char *__pyx_filename = NULL;
17670  int __pyx_clineno = 0;
17671  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
17672 
17673  /* "View.MemoryView":1007
17674  * cdef _memoryviewslice result
17675  *
17676  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17677  * return None
17678  *
17679  */
17680  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17681  if (__pyx_t_1) {
17682 
17683  /* "View.MemoryView":1008
17684  *
17685  * if <PyObject *> memviewslice.memview == Py_None:
17686  * return None # <<<<<<<<<<<<<<
17687  *
17688  *
17689  */
17690  __Pyx_XDECREF(__pyx_r);
17691  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17692  goto __pyx_L0;
17693 
17694  /* "View.MemoryView":1007
17695  * cdef _memoryviewslice result
17696  *
17697  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17698  * return None
17699  *
17700  */
17701  }
17702 
17703  /* "View.MemoryView":1013
17704  *
17705  *
17706  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
17707  *
17708  * result.from_slice = memviewslice
17709  */
17710  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
17711  __Pyx_GOTREF(__pyx_t_2);
17712  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1013, __pyx_L1_error)
17713  __Pyx_GOTREF(__pyx_t_3);
17714  __Pyx_INCREF(Py_None);
17715  __Pyx_GIVEREF(Py_None);
17716  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17717  __Pyx_INCREF(__pyx_int_0);
17718  __Pyx_GIVEREF(__pyx_int_0);
17719  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17720  __Pyx_GIVEREF(__pyx_t_2);
17721  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17722  __pyx_t_2 = 0;
17723  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
17724  __Pyx_GOTREF(__pyx_t_2);
17725  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17726  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17727  __pyx_t_2 = 0;
17728 
17729  /* "View.MemoryView":1015
17730  * result = _memoryviewslice(None, 0, dtype_is_object)
17731  *
17732  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
17733  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17734  *
17735  */
17736  __pyx_v_result->from_slice = __pyx_v_memviewslice;
17737 
17738  /* "View.MemoryView":1016
17739  *
17740  * result.from_slice = memviewslice
17741  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
17742  *
17743  * result.from_object = (<memoryview> memviewslice.memview).base
17744  */
17745  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17746 
17747  /* "View.MemoryView":1018
17748  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17749  *
17750  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
17751  * result.typeinfo = memviewslice.memview.typeinfo
17752  *
17753  */
17754  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1018, __pyx_L1_error)
17755  __Pyx_GOTREF(__pyx_t_2);
17756  __Pyx_GIVEREF(__pyx_t_2);
17757  __Pyx_GOTREF(__pyx_v_result->from_object);
17758  __Pyx_DECREF(__pyx_v_result->from_object);
17759  __pyx_v_result->from_object = __pyx_t_2;
17760  __pyx_t_2 = 0;
17761 
17762  /* "View.MemoryView":1019
17763  *
17764  * result.from_object = (<memoryview> memviewslice.memview).base
17765  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
17766  *
17767  * result.view = memviewslice.memview.view
17768  */
17769  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17770  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17771 
17772  /* "View.MemoryView":1021
17773  * result.typeinfo = memviewslice.memview.typeinfo
17774  *
17775  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
17776  * result.view.buf = <void *> memviewslice.data
17777  * result.view.ndim = ndim
17778  */
17779  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17780  __pyx_v_result->__pyx_base.view = __pyx_t_5;
17781 
17782  /* "View.MemoryView":1022
17783  *
17784  * result.view = memviewslice.memview.view
17785  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
17786  * result.view.ndim = ndim
17787  * (<__pyx_buffer *> &result.view).obj = Py_None
17788  */
17789  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
17790 
17791  /* "View.MemoryView":1023
17792  * result.view = memviewslice.memview.view
17793  * result.view.buf = <void *> memviewslice.data
17794  * result.view.ndim = ndim # <<<<<<<<<<<<<<
17795  * (<__pyx_buffer *> &result.view).obj = Py_None
17796  * Py_INCREF(Py_None)
17797  */
17798  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17799 
17800  /* "View.MemoryView":1024
17801  * result.view.buf = <void *> memviewslice.data
17802  * result.view.ndim = ndim
17803  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
17804  * Py_INCREF(Py_None)
17805  *
17806  */
17807  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17808 
17809  /* "View.MemoryView":1025
17810  * result.view.ndim = ndim
17811  * (<__pyx_buffer *> &result.view).obj = Py_None
17812  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
17813  *
17814  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17815  */
17816  Py_INCREF(Py_None);
17817 
17818  /* "View.MemoryView":1027
17819  * Py_INCREF(Py_None)
17820  *
17821  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17822  * result.flags = PyBUF_RECORDS
17823  * else:
17824  */
17825  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17826  if (__pyx_t_1) {
17827 
17828  /* "View.MemoryView":1028
17829  *
17830  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17831  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
17832  * else:
17833  * result.flags = PyBUF_RECORDS_RO
17834  */
17835  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17836 
17837  /* "View.MemoryView":1027
17838  * Py_INCREF(Py_None)
17839  *
17840  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17841  * result.flags = PyBUF_RECORDS
17842  * else:
17843  */
17844  goto __pyx_L4;
17845  }
17846 
17847  /* "View.MemoryView":1030
17848  * result.flags = PyBUF_RECORDS
17849  * else:
17850  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
17851  *
17852  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17853  */
17854  /*else*/ {
17855  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17856  }
17857  __pyx_L4:;
17858 
17859  /* "View.MemoryView":1032
17860  * result.flags = PyBUF_RECORDS_RO
17861  *
17862  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
17863  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
17864  *
17865  */
17866  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17867 
17868  /* "View.MemoryView":1033
17869  *
17870  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17871  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
17872  *
17873  *
17874  */
17875  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17876 
17877  /* "View.MemoryView":1036
17878  *
17879  *
17880  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
17881  * for suboffset in result.from_slice.suboffsets[:ndim]:
17882  * if suboffset >= 0:
17883  */
17884  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17885 
17886  /* "View.MemoryView":1037
17887  *
17888  * result.view.suboffsets = NULL
17889  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
17890  * if suboffset >= 0:
17891  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17892  */
17893  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17894  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17895  __pyx_t_6 = __pyx_t_8;
17896  __pyx_v_suboffset = (__pyx_t_6[0]);
17897 
17898  /* "View.MemoryView":1038
17899  * result.view.suboffsets = NULL
17900  * for suboffset in result.from_slice.suboffsets[:ndim]:
17901  * if suboffset >= 0: # <<<<<<<<<<<<<<
17902  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17903  * break
17904  */
17905  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17906  if (__pyx_t_1) {
17907 
17908  /* "View.MemoryView":1039
17909  * for suboffset in result.from_slice.suboffsets[:ndim]:
17910  * if suboffset >= 0:
17911  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
17912  * break
17913  *
17914  */
17915  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17916 
17917  /* "View.MemoryView":1040
17918  * if suboffset >= 0:
17919  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17920  * break # <<<<<<<<<<<<<<
17921  *
17922  * result.view.len = result.view.itemsize
17923  */
17924  goto __pyx_L6_break;
17925 
17926  /* "View.MemoryView":1038
17927  * result.view.suboffsets = NULL
17928  * for suboffset in result.from_slice.suboffsets[:ndim]:
17929  * if suboffset >= 0: # <<<<<<<<<<<<<<
17930  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17931  * break
17932  */
17933  }
17934  }
17935  __pyx_L6_break:;
17936 
17937  /* "View.MemoryView":1042
17938  * break
17939  *
17940  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
17941  * for length in result.view.shape[:ndim]:
17942  * result.view.len *= length
17943  */
17944  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17945  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17946 
17947  /* "View.MemoryView":1043
17948  *
17949  * result.view.len = result.view.itemsize
17950  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
17951  * result.view.len *= length
17952  *
17953  */
17954  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17955  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17956  __pyx_t_6 = __pyx_t_8;
17957  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1043, __pyx_L1_error)
17958  __Pyx_GOTREF(__pyx_t_2);
17959  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17960  __pyx_t_2 = 0;
17961 
17962  /* "View.MemoryView":1044
17963  * result.view.len = result.view.itemsize
17964  * for length in result.view.shape[:ndim]:
17965  * result.view.len *= length # <<<<<<<<<<<<<<
17966  *
17967  * result.to_object_func = to_object_func
17968  */
17969  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error)
17970  __Pyx_GOTREF(__pyx_t_2);
17971  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1044, __pyx_L1_error)
17972  __Pyx_GOTREF(__pyx_t_3);
17973  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17974  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1044, __pyx_L1_error)
17975  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17976  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17977  }
17978 
17979  /* "View.MemoryView":1046
17980  * result.view.len *= length
17981  *
17982  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
17983  * result.to_dtype_func = to_dtype_func
17984  *
17985  */
17986  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17987 
17988  /* "View.MemoryView":1047
17989  *
17990  * result.to_object_func = to_object_func
17991  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
17992  *
17993  * return result
17994  */
17995  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17996 
17997  /* "View.MemoryView":1049
17998  * result.to_dtype_func = to_dtype_func
17999  *
18000  * return result # <<<<<<<<<<<<<<
18001  *
18002  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18003  */
18004  __Pyx_XDECREF(__pyx_r);
18005  __Pyx_INCREF(((PyObject *)__pyx_v_result));
18006  __pyx_r = ((PyObject *)__pyx_v_result);
18007  goto __pyx_L0;
18008 
18009  /* "View.MemoryView":999
18010  *
18011  * @cname('__pyx_memoryview_fromslice')
18012  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18013  * int ndim,
18014  * object (*to_object_func)(char *),
18015  */
18016 
18017  /* function exit code */
18018  __pyx_L1_error:;
18019  __Pyx_XDECREF(__pyx_t_2);
18020  __Pyx_XDECREF(__pyx_t_3);
18021  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18022  __pyx_r = 0;
18023  __pyx_L0:;
18024  __Pyx_XDECREF((PyObject *)__pyx_v_result);
18025  __Pyx_XDECREF(__pyx_v_length);
18026  __Pyx_XGIVEREF(__pyx_r);
18027  __Pyx_RefNannyFinishContext();
18028  return __pyx_r;
18029 }
18030 
18031 /* "View.MemoryView":1052
18032  *
18033  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18034  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18035  * __Pyx_memviewslice *mslice) except NULL:
18036  * cdef _memoryviewslice obj
18037  */
18038 
18039 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18040  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18041  __Pyx_memviewslice *__pyx_r;
18042  __Pyx_RefNannyDeclarations
18043  int __pyx_t_1;
18044  int __pyx_t_2;
18045  PyObject *__pyx_t_3 = NULL;
18046  int __pyx_lineno = 0;
18047  const char *__pyx_filename = NULL;
18048  int __pyx_clineno = 0;
18049  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
18050 
18051  /* "View.MemoryView":1055
18052  * __Pyx_memviewslice *mslice) except NULL:
18053  * cdef _memoryviewslice obj
18054  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18055  * obj = memview
18056  * return &obj.from_slice
18057  */
18058  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18059  __pyx_t_2 = (__pyx_t_1 != 0);
18060  if (__pyx_t_2) {
18061 
18062  /* "View.MemoryView":1056
18063  * cdef _memoryviewslice obj
18064  * if isinstance(memview, _memoryviewslice):
18065  * obj = memview # <<<<<<<<<<<<<<
18066  * return &obj.from_slice
18067  * else:
18068  */
18069  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1056, __pyx_L1_error)
18070  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18071  __Pyx_INCREF(__pyx_t_3);
18072  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18073  __pyx_t_3 = 0;
18074 
18075  /* "View.MemoryView":1057
18076  * if isinstance(memview, _memoryviewslice):
18077  * obj = memview
18078  * return &obj.from_slice # <<<<<<<<<<<<<<
18079  * else:
18080  * slice_copy(memview, mslice)
18081  */
18082  __pyx_r = (&__pyx_v_obj->from_slice);
18083  goto __pyx_L0;
18084 
18085  /* "View.MemoryView":1055
18086  * __Pyx_memviewslice *mslice) except NULL:
18087  * cdef _memoryviewslice obj
18088  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18089  * obj = memview
18090  * return &obj.from_slice
18091  */
18092  }
18093 
18094  /* "View.MemoryView":1059
18095  * return &obj.from_slice
18096  * else:
18097  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
18098  * return mslice
18099  *
18100  */
18101  /*else*/ {
18102  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18103 
18104  /* "View.MemoryView":1060
18105  * else:
18106  * slice_copy(memview, mslice)
18107  * return mslice # <<<<<<<<<<<<<<
18108  *
18109  * @cname('__pyx_memoryview_slice_copy')
18110  */
18111  __pyx_r = __pyx_v_mslice;
18112  goto __pyx_L0;
18113  }
18114 
18115  /* "View.MemoryView":1052
18116  *
18117  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18118  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18119  * __Pyx_memviewslice *mslice) except NULL:
18120  * cdef _memoryviewslice obj
18121  */
18122 
18123  /* function exit code */
18124  __pyx_L1_error:;
18125  __Pyx_XDECREF(__pyx_t_3);
18126  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
18127  __pyx_r = NULL;
18128  __pyx_L0:;
18129  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18130  __Pyx_RefNannyFinishContext();
18131  return __pyx_r;
18132 }
18133 
18134 /* "View.MemoryView":1063
18135  *
18136  * @cname('__pyx_memoryview_slice_copy')
18137  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18138  * cdef int dim
18139  * cdef (Py_ssize_t*) shape, strides, suboffsets
18140  */
18141 
18142 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18143  int __pyx_v_dim;
18144  Py_ssize_t *__pyx_v_shape;
18145  Py_ssize_t *__pyx_v_strides;
18146  Py_ssize_t *__pyx_v_suboffsets;
18147  __Pyx_RefNannyDeclarations
18148  Py_ssize_t *__pyx_t_1;
18149  int __pyx_t_2;
18150  int __pyx_t_3;
18151  int __pyx_t_4;
18152  Py_ssize_t __pyx_t_5;
18153  __Pyx_RefNannySetupContext("slice_copy", 0);
18154 
18155  /* "View.MemoryView":1067
18156  * cdef (Py_ssize_t*) shape, strides, suboffsets
18157  *
18158  * shape = memview.view.shape # <<<<<<<<<<<<<<
18159  * strides = memview.view.strides
18160  * suboffsets = memview.view.suboffsets
18161  */
18162  __pyx_t_1 = __pyx_v_memview->view.shape;
18163  __pyx_v_shape = __pyx_t_1;
18164 
18165  /* "View.MemoryView":1068
18166  *
18167  * shape = memview.view.shape
18168  * strides = memview.view.strides # <<<<<<<<<<<<<<
18169  * suboffsets = memview.view.suboffsets
18170  *
18171  */
18172  __pyx_t_1 = __pyx_v_memview->view.strides;
18173  __pyx_v_strides = __pyx_t_1;
18174 
18175  /* "View.MemoryView":1069
18176  * shape = memview.view.shape
18177  * strides = memview.view.strides
18178  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
18179  *
18180  * dst.memview = <__pyx_memoryview *> memview
18181  */
18182  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18183  __pyx_v_suboffsets = __pyx_t_1;
18184 
18185  /* "View.MemoryView":1071
18186  * suboffsets = memview.view.suboffsets
18187  *
18188  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
18189  * dst.data = <char *> memview.view.buf
18190  *
18191  */
18192  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
18193 
18194  /* "View.MemoryView":1072
18195  *
18196  * dst.memview = <__pyx_memoryview *> memview
18197  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
18198  *
18199  * for dim in range(memview.view.ndim):
18200  */
18201  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
18202 
18203  /* "View.MemoryView":1074
18204  * dst.data = <char *> memview.view.buf
18205  *
18206  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
18207  * dst.shape[dim] = shape[dim]
18208  * dst.strides[dim] = strides[dim]
18209  */
18210  __pyx_t_2 = __pyx_v_memview->view.ndim;
18211  __pyx_t_3 = __pyx_t_2;
18212  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18213  __pyx_v_dim = __pyx_t_4;
18214 
18215  /* "View.MemoryView":1075
18216  *
18217  * for dim in range(memview.view.ndim):
18218  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
18219  * dst.strides[dim] = strides[dim]
18220  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18221  */
18222  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18223 
18224  /* "View.MemoryView":1076
18225  * for dim in range(memview.view.ndim):
18226  * dst.shape[dim] = shape[dim]
18227  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
18228  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18229  *
18230  */
18231  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18232 
18233  /* "View.MemoryView":1077
18234  * dst.shape[dim] = shape[dim]
18235  * dst.strides[dim] = strides[dim]
18236  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
18237  *
18238  * @cname('__pyx_memoryview_copy_object')
18239  */
18240  if ((__pyx_v_suboffsets != 0)) {
18241  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18242  } else {
18243  __pyx_t_5 = -1L;
18244  }
18245  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18246  }
18247 
18248  /* "View.MemoryView":1063
18249  *
18250  * @cname('__pyx_memoryview_slice_copy')
18251  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18252  * cdef int dim
18253  * cdef (Py_ssize_t*) shape, strides, suboffsets
18254  */
18255 
18256  /* function exit code */
18257  __Pyx_RefNannyFinishContext();
18258 }
18259 
18260 /* "View.MemoryView":1080
18261  *
18262  * @cname('__pyx_memoryview_copy_object')
18263  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18264  * "Create a new memoryview object"
18265  * cdef __Pyx_memviewslice memviewslice
18266  */
18267 
18268 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
18269  __Pyx_memviewslice __pyx_v_memviewslice;
18270  PyObject *__pyx_r = NULL;
18271  __Pyx_RefNannyDeclarations
18272  PyObject *__pyx_t_1 = NULL;
18273  int __pyx_lineno = 0;
18274  const char *__pyx_filename = NULL;
18275  int __pyx_clineno = 0;
18276  __Pyx_RefNannySetupContext("memoryview_copy", 0);
18277 
18278  /* "View.MemoryView":1083
18279  * "Create a new memoryview object"
18280  * cdef __Pyx_memviewslice memviewslice
18281  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
18282  * return memoryview_copy_from_slice(memview, &memviewslice)
18283  *
18284  */
18285  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18286 
18287  /* "View.MemoryView":1084
18288  * cdef __Pyx_memviewslice memviewslice
18289  * slice_copy(memview, &memviewslice)
18290  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
18291  *
18292  * @cname('__pyx_memoryview_copy_object_from_slice')
18293  */
18294  __Pyx_XDECREF(__pyx_r);
18295  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1084, __pyx_L1_error)
18296  __Pyx_GOTREF(__pyx_t_1);
18297  __pyx_r = __pyx_t_1;
18298  __pyx_t_1 = 0;
18299  goto __pyx_L0;
18300 
18301  /* "View.MemoryView":1080
18302  *
18303  * @cname('__pyx_memoryview_copy_object')
18304  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18305  * "Create a new memoryview object"
18306  * cdef __Pyx_memviewslice memviewslice
18307  */
18308 
18309  /* function exit code */
18310  __pyx_L1_error:;
18311  __Pyx_XDECREF(__pyx_t_1);
18312  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18313  __pyx_r = 0;
18314  __pyx_L0:;
18315  __Pyx_XGIVEREF(__pyx_r);
18316  __Pyx_RefNannyFinishContext();
18317  return __pyx_r;
18318 }
18319 
18320 /* "View.MemoryView":1087
18321  *
18322  * @cname('__pyx_memoryview_copy_object_from_slice')
18323  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18324  * """
18325  * Create a new memoryview object from a given memoryview object and slice.
18326  */
18327 
18328 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18329  PyObject *(*__pyx_v_to_object_func)(char *);
18330  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
18331  PyObject *__pyx_r = NULL;
18332  __Pyx_RefNannyDeclarations
18333  int __pyx_t_1;
18334  int __pyx_t_2;
18335  PyObject *(*__pyx_t_3)(char *);
18336  int (*__pyx_t_4)(char *, PyObject *);
18337  PyObject *__pyx_t_5 = NULL;
18338  int __pyx_lineno = 0;
18339  const char *__pyx_filename = NULL;
18340  int __pyx_clineno = 0;
18341  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
18342 
18343  /* "View.MemoryView":1094
18344  * cdef int (*to_dtype_func)(char *, object) except 0
18345  *
18346  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18347  * to_object_func = (<_memoryviewslice> memview).to_object_func
18348  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18349  */
18350  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18351  __pyx_t_2 = (__pyx_t_1 != 0);
18352  if (__pyx_t_2) {
18353 
18354  /* "View.MemoryView":1095
18355  *
18356  * if isinstance(memview, _memoryviewslice):
18357  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
18358  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18359  * else:
18360  */
18361  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18362  __pyx_v_to_object_func = __pyx_t_3;
18363 
18364  /* "View.MemoryView":1096
18365  * if isinstance(memview, _memoryviewslice):
18366  * to_object_func = (<_memoryviewslice> memview).to_object_func
18367  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
18368  * else:
18369  * to_object_func = NULL
18370  */
18371  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18372  __pyx_v_to_dtype_func = __pyx_t_4;
18373 
18374  /* "View.MemoryView":1094
18375  * cdef int (*to_dtype_func)(char *, object) except 0
18376  *
18377  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18378  * to_object_func = (<_memoryviewslice> memview).to_object_func
18379  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18380  */
18381  goto __pyx_L3;
18382  }
18383 
18384  /* "View.MemoryView":1098
18385  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18386  * else:
18387  * to_object_func = NULL # <<<<<<<<<<<<<<
18388  * to_dtype_func = NULL
18389  *
18390  */
18391  /*else*/ {
18392  __pyx_v_to_object_func = NULL;
18393 
18394  /* "View.MemoryView":1099
18395  * else:
18396  * to_object_func = NULL
18397  * to_dtype_func = NULL # <<<<<<<<<<<<<<
18398  *
18399  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18400  */
18401  __pyx_v_to_dtype_func = NULL;
18402  }
18403  __pyx_L3:;
18404 
18405  /* "View.MemoryView":1101
18406  * to_dtype_func = NULL
18407  *
18408  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
18409  * to_object_func, to_dtype_func,
18410  * memview.dtype_is_object)
18411  */
18412  __Pyx_XDECREF(__pyx_r);
18413 
18414  /* "View.MemoryView":1103
18415  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18416  * to_object_func, to_dtype_func,
18417  * memview.dtype_is_object) # <<<<<<<<<<<<<<
18418  *
18419  *
18420  */
18421  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1101, __pyx_L1_error)
18422  __Pyx_GOTREF(__pyx_t_5);
18423  __pyx_r = __pyx_t_5;
18424  __pyx_t_5 = 0;
18425  goto __pyx_L0;
18426 
18427  /* "View.MemoryView":1087
18428  *
18429  * @cname('__pyx_memoryview_copy_object_from_slice')
18430  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18431  * """
18432  * Create a new memoryview object from a given memoryview object and slice.
18433  */
18434 
18435  /* function exit code */
18436  __pyx_L1_error:;
18437  __Pyx_XDECREF(__pyx_t_5);
18438  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18439  __pyx_r = 0;
18440  __pyx_L0:;
18441  __Pyx_XGIVEREF(__pyx_r);
18442  __Pyx_RefNannyFinishContext();
18443  return __pyx_r;
18444 }
18445 
18446 /* "View.MemoryView":1109
18447  *
18448  *
18449  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18450  * if arg < 0:
18451  * return -arg
18452  */
18453 
18454 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18455  Py_ssize_t __pyx_r;
18456  int __pyx_t_1;
18457 
18458  /* "View.MemoryView":1110
18459  *
18460  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18461  * if arg < 0: # <<<<<<<<<<<<<<
18462  * return -arg
18463  * else:
18464  */
18465  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18466  if (__pyx_t_1) {
18467 
18468  /* "View.MemoryView":1111
18469  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18470  * if arg < 0:
18471  * return -arg # <<<<<<<<<<<<<<
18472  * else:
18473  * return arg
18474  */
18475  __pyx_r = (-__pyx_v_arg);
18476  goto __pyx_L0;
18477 
18478  /* "View.MemoryView":1110
18479  *
18480  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18481  * if arg < 0: # <<<<<<<<<<<<<<
18482  * return -arg
18483  * else:
18484  */
18485  }
18486 
18487  /* "View.MemoryView":1113
18488  * return -arg
18489  * else:
18490  * return arg # <<<<<<<<<<<<<<
18491  *
18492  * @cname('__pyx_get_best_slice_order')
18493  */
18494  /*else*/ {
18495  __pyx_r = __pyx_v_arg;
18496  goto __pyx_L0;
18497  }
18498 
18499  /* "View.MemoryView":1109
18500  *
18501  *
18502  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18503  * if arg < 0:
18504  * return -arg
18505  */
18506 
18507  /* function exit code */
18508  __pyx_L0:;
18509  return __pyx_r;
18510 }
18511 
18512 /* "View.MemoryView":1116
18513  *
18514  * @cname('__pyx_get_best_slice_order')
18515  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18516  * """
18517  * Figure out the best memory access order for a given slice.
18518  */
18519 
18520 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
18521  int __pyx_v_i;
18522  Py_ssize_t __pyx_v_c_stride;
18523  Py_ssize_t __pyx_v_f_stride;
18524  char __pyx_r;
18525  int __pyx_t_1;
18526  int __pyx_t_2;
18527  int __pyx_t_3;
18528  int __pyx_t_4;
18529 
18530  /* "View.MemoryView":1121
18531  * """
18532  * cdef int i
18533  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
18534  * cdef Py_ssize_t f_stride = 0
18535  *
18536  */
18537  __pyx_v_c_stride = 0;
18538 
18539  /* "View.MemoryView":1122
18540  * cdef int i
18541  * cdef Py_ssize_t c_stride = 0
18542  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
18543  *
18544  * for i in range(ndim - 1, -1, -1):
18545  */
18546  __pyx_v_f_stride = 0;
18547 
18548  /* "View.MemoryView":1124
18549  * cdef Py_ssize_t f_stride = 0
18550  *
18551  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18552  * if mslice.shape[i] > 1:
18553  * c_stride = mslice.strides[i]
18554  */
18555  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18556  __pyx_v_i = __pyx_t_1;
18557 
18558  /* "View.MemoryView":1125
18559  *
18560  * for i in range(ndim - 1, -1, -1):
18561  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18562  * c_stride = mslice.strides[i]
18563  * break
18564  */
18565  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18566  if (__pyx_t_2) {
18567 
18568  /* "View.MemoryView":1126
18569  * for i in range(ndim - 1, -1, -1):
18570  * if mslice.shape[i] > 1:
18571  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18572  * break
18573  *
18574  */
18575  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18576 
18577  /* "View.MemoryView":1127
18578  * if mslice.shape[i] > 1:
18579  * c_stride = mslice.strides[i]
18580  * break # <<<<<<<<<<<<<<
18581  *
18582  * for i in range(ndim):
18583  */
18584  goto __pyx_L4_break;
18585 
18586  /* "View.MemoryView":1125
18587  *
18588  * for i in range(ndim - 1, -1, -1):
18589  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18590  * c_stride = mslice.strides[i]
18591  * break
18592  */
18593  }
18594  }
18595  __pyx_L4_break:;
18596 
18597  /* "View.MemoryView":1129
18598  * break
18599  *
18600  * for i in range(ndim): # <<<<<<<<<<<<<<
18601  * if mslice.shape[i] > 1:
18602  * f_stride = mslice.strides[i]
18603  */
18604  __pyx_t_1 = __pyx_v_ndim;
18605  __pyx_t_3 = __pyx_t_1;
18606  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18607  __pyx_v_i = __pyx_t_4;
18608 
18609  /* "View.MemoryView":1130
18610  *
18611  * for i in range(ndim):
18612  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18613  * f_stride = mslice.strides[i]
18614  * break
18615  */
18616  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18617  if (__pyx_t_2) {
18618 
18619  /* "View.MemoryView":1131
18620  * for i in range(ndim):
18621  * if mslice.shape[i] > 1:
18622  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18623  * break
18624  *
18625  */
18626  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18627 
18628  /* "View.MemoryView":1132
18629  * if mslice.shape[i] > 1:
18630  * f_stride = mslice.strides[i]
18631  * break # <<<<<<<<<<<<<<
18632  *
18633  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18634  */
18635  goto __pyx_L7_break;
18636 
18637  /* "View.MemoryView":1130
18638  *
18639  * for i in range(ndim):
18640  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18641  * f_stride = mslice.strides[i]
18642  * break
18643  */
18644  }
18645  }
18646  __pyx_L7_break:;
18647 
18648  /* "View.MemoryView":1134
18649  * break
18650  *
18651  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18652  * return 'C'
18653  * else:
18654  */
18655  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18656  if (__pyx_t_2) {
18657 
18658  /* "View.MemoryView":1135
18659  *
18660  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18661  * return 'C' # <<<<<<<<<<<<<<
18662  * else:
18663  * return 'F'
18664  */
18665  __pyx_r = 'C';
18666  goto __pyx_L0;
18667 
18668  /* "View.MemoryView":1134
18669  * break
18670  *
18671  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18672  * return 'C'
18673  * else:
18674  */
18675  }
18676 
18677  /* "View.MemoryView":1137
18678  * return 'C'
18679  * else:
18680  * return 'F' # <<<<<<<<<<<<<<
18681  *
18682  * @cython.cdivision(True)
18683  */
18684  /*else*/ {
18685  __pyx_r = 'F';
18686  goto __pyx_L0;
18687  }
18688 
18689  /* "View.MemoryView":1116
18690  *
18691  * @cname('__pyx_get_best_slice_order')
18692  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18693  * """
18694  * Figure out the best memory access order for a given slice.
18695  */
18696 
18697  /* function exit code */
18698  __pyx_L0:;
18699  return __pyx_r;
18700 }
18701 
18702 /* "View.MemoryView":1140
18703  *
18704  * @cython.cdivision(True)
18705  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18706  * char *dst_data, Py_ssize_t *dst_strides,
18707  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18708  */
18709 
18710 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18711  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18712  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18713  Py_ssize_t __pyx_v_dst_extent;
18714  Py_ssize_t __pyx_v_src_stride;
18715  Py_ssize_t __pyx_v_dst_stride;
18716  int __pyx_t_1;
18717  int __pyx_t_2;
18718  int __pyx_t_3;
18719  Py_ssize_t __pyx_t_4;
18720  Py_ssize_t __pyx_t_5;
18721  Py_ssize_t __pyx_t_6;
18722 
18723  /* "View.MemoryView":1147
18724  *
18725  * cdef Py_ssize_t i
18726  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
18727  * cdef Py_ssize_t dst_extent = dst_shape[0]
18728  * cdef Py_ssize_t src_stride = src_strides[0]
18729  */
18730  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18731 
18732  /* "View.MemoryView":1148
18733  * cdef Py_ssize_t i
18734  * cdef Py_ssize_t src_extent = src_shape[0]
18735  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
18736  * cdef Py_ssize_t src_stride = src_strides[0]
18737  * cdef Py_ssize_t dst_stride = dst_strides[0]
18738  */
18739  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18740 
18741  /* "View.MemoryView":1149
18742  * cdef Py_ssize_t src_extent = src_shape[0]
18743  * cdef Py_ssize_t dst_extent = dst_shape[0]
18744  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
18745  * cdef Py_ssize_t dst_stride = dst_strides[0]
18746  *
18747  */
18748  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18749 
18750  /* "View.MemoryView":1150
18751  * cdef Py_ssize_t dst_extent = dst_shape[0]
18752  * cdef Py_ssize_t src_stride = src_strides[0]
18753  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
18754  *
18755  * if ndim == 1:
18756  */
18757  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18758 
18759  /* "View.MemoryView":1152
18760  * cdef Py_ssize_t dst_stride = dst_strides[0]
18761  *
18762  * if ndim == 1: # <<<<<<<<<<<<<<
18763  * if (src_stride > 0 and dst_stride > 0 and
18764  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18765  */
18766  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18767  if (__pyx_t_1) {
18768 
18769  /* "View.MemoryView":1153
18770  *
18771  * if ndim == 1:
18772  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18773  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18774  * memcpy(dst_data, src_data, itemsize * dst_extent)
18775  */
18776  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18777  if (__pyx_t_2) {
18778  } else {
18779  __pyx_t_1 = __pyx_t_2;
18780  goto __pyx_L5_bool_binop_done;
18781  }
18782  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18783  if (__pyx_t_2) {
18784  } else {
18785  __pyx_t_1 = __pyx_t_2;
18786  goto __pyx_L5_bool_binop_done;
18787  }
18788 
18789  /* "View.MemoryView":1154
18790  * if ndim == 1:
18791  * if (src_stride > 0 and dst_stride > 0 and
18792  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
18793  * memcpy(dst_data, src_data, itemsize * dst_extent)
18794  * else:
18795  */
18796  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18797  if (__pyx_t_2) {
18798  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18799  }
18800  __pyx_t_3 = (__pyx_t_2 != 0);
18801  __pyx_t_1 = __pyx_t_3;
18802  __pyx_L5_bool_binop_done:;
18803 
18804  /* "View.MemoryView":1153
18805  *
18806  * if ndim == 1:
18807  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18808  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18809  * memcpy(dst_data, src_data, itemsize * dst_extent)
18810  */
18811  if (__pyx_t_1) {
18812 
18813  /* "View.MemoryView":1155
18814  * if (src_stride > 0 and dst_stride > 0 and
18815  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18816  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
18817  * else:
18818  * for i in range(dst_extent):
18819  */
18820  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18821 
18822  /* "View.MemoryView":1153
18823  *
18824  * if ndim == 1:
18825  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18826  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18827  * memcpy(dst_data, src_data, itemsize * dst_extent)
18828  */
18829  goto __pyx_L4;
18830  }
18831 
18832  /* "View.MemoryView":1157
18833  * memcpy(dst_data, src_data, itemsize * dst_extent)
18834  * else:
18835  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18836  * memcpy(dst_data, src_data, itemsize)
18837  * src_data += src_stride
18838  */
18839  /*else*/ {
18840  __pyx_t_4 = __pyx_v_dst_extent;
18841  __pyx_t_5 = __pyx_t_4;
18842  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18843  __pyx_v_i = __pyx_t_6;
18844 
18845  /* "View.MemoryView":1158
18846  * else:
18847  * for i in range(dst_extent):
18848  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
18849  * src_data += src_stride
18850  * dst_data += dst_stride
18851  */
18852  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18853 
18854  /* "View.MemoryView":1159
18855  * for i in range(dst_extent):
18856  * memcpy(dst_data, src_data, itemsize)
18857  * src_data += src_stride # <<<<<<<<<<<<<<
18858  * dst_data += dst_stride
18859  * else:
18860  */
18861  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18862 
18863  /* "View.MemoryView":1160
18864  * memcpy(dst_data, src_data, itemsize)
18865  * src_data += src_stride
18866  * dst_data += dst_stride # <<<<<<<<<<<<<<
18867  * else:
18868  * for i in range(dst_extent):
18869  */
18870  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18871  }
18872  }
18873  __pyx_L4:;
18874 
18875  /* "View.MemoryView":1152
18876  * cdef Py_ssize_t dst_stride = dst_strides[0]
18877  *
18878  * if ndim == 1: # <<<<<<<<<<<<<<
18879  * if (src_stride > 0 and dst_stride > 0 and
18880  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18881  */
18882  goto __pyx_L3;
18883  }
18884 
18885  /* "View.MemoryView":1162
18886  * dst_data += dst_stride
18887  * else:
18888  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18889  * _copy_strided_to_strided(src_data, src_strides + 1,
18890  * dst_data, dst_strides + 1,
18891  */
18892  /*else*/ {
18893  __pyx_t_4 = __pyx_v_dst_extent;
18894  __pyx_t_5 = __pyx_t_4;
18895  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18896  __pyx_v_i = __pyx_t_6;
18897 
18898  /* "View.MemoryView":1163
18899  * else:
18900  * for i in range(dst_extent):
18901  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
18902  * dst_data, dst_strides + 1,
18903  * src_shape + 1, dst_shape + 1,
18904  */
18905  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18906 
18907  /* "View.MemoryView":1167
18908  * src_shape + 1, dst_shape + 1,
18909  * ndim - 1, itemsize)
18910  * src_data += src_stride # <<<<<<<<<<<<<<
18911  * dst_data += dst_stride
18912  *
18913  */
18914  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18915 
18916  /* "View.MemoryView":1168
18917  * ndim - 1, itemsize)
18918  * src_data += src_stride
18919  * dst_data += dst_stride # <<<<<<<<<<<<<<
18920  *
18921  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
18922  */
18923  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18924  }
18925  }
18926  __pyx_L3:;
18927 
18928  /* "View.MemoryView":1140
18929  *
18930  * @cython.cdivision(True)
18931  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18932  * char *dst_data, Py_ssize_t *dst_strides,
18933  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18934  */
18935 
18936  /* function exit code */
18937 }
18938 
18939 /* "View.MemoryView":1170
18940  * dst_data += dst_stride
18941  *
18942  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18943  * __Pyx_memviewslice *dst,
18944  * int ndim, size_t itemsize) nogil:
18945  */
18946 
18947 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18948 
18949  /* "View.MemoryView":1173
18950  * __Pyx_memviewslice *dst,
18951  * int ndim, size_t itemsize) nogil:
18952  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
18953  * src.shape, dst.shape, ndim, itemsize)
18954  *
18955  */
18956  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18957 
18958  /* "View.MemoryView":1170
18959  * dst_data += dst_stride
18960  *
18961  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18962  * __Pyx_memviewslice *dst,
18963  * int ndim, size_t itemsize) nogil:
18964  */
18965 
18966  /* function exit code */
18967 }
18968 
18969 /* "View.MemoryView":1177
18970  *
18971  * @cname('__pyx_memoryview_slice_get_size')
18972  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18973  * "Return the size of the memory occupied by the slice in number of bytes"
18974  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18975  */
18976 
18977 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
18978  Py_ssize_t __pyx_v_shape;
18979  Py_ssize_t __pyx_v_size;
18980  Py_ssize_t __pyx_r;
18981  Py_ssize_t __pyx_t_1;
18982  Py_ssize_t *__pyx_t_2;
18983  Py_ssize_t *__pyx_t_3;
18984  Py_ssize_t *__pyx_t_4;
18985 
18986  /* "View.MemoryView":1179
18987  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
18988  * "Return the size of the memory occupied by the slice in number of bytes"
18989  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
18990  *
18991  * for shape in src.shape[:ndim]:
18992  */
18993  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18994  __pyx_v_size = __pyx_t_1;
18995 
18996  /* "View.MemoryView":1181
18997  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18998  *
18999  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
19000  * size *= shape
19001  *
19002  */
19003  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
19004  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
19005  __pyx_t_2 = __pyx_t_4;
19006  __pyx_v_shape = (__pyx_t_2[0]);
19007 
19008  /* "View.MemoryView":1182
19009  *
19010  * for shape in src.shape[:ndim]:
19011  * size *= shape # <<<<<<<<<<<<<<
19012  *
19013  * return size
19014  */
19015  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
19016  }
19017 
19018  /* "View.MemoryView":1184
19019  * size *= shape
19020  *
19021  * return size # <<<<<<<<<<<<<<
19022  *
19023  * @cname('__pyx_fill_contig_strides_array')
19024  */
19025  __pyx_r = __pyx_v_size;
19026  goto __pyx_L0;
19027 
19028  /* "View.MemoryView":1177
19029  *
19030  * @cname('__pyx_memoryview_slice_get_size')
19031  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19032  * "Return the size of the memory occupied by the slice in number of bytes"
19033  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19034  */
19035 
19036  /* function exit code */
19037  __pyx_L0:;
19038  return __pyx_r;
19039 }
19040 
19041 /* "View.MemoryView":1187
19042  *
19043  * @cname('__pyx_fill_contig_strides_array')
19044  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19045  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19046  * int ndim, char order) nogil:
19047  */
19048 
19049 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
19050  int __pyx_v_idx;
19051  Py_ssize_t __pyx_r;
19052  int __pyx_t_1;
19053  int __pyx_t_2;
19054  int __pyx_t_3;
19055  int __pyx_t_4;
19056 
19057  /* "View.MemoryView":1196
19058  * cdef int idx
19059  *
19060  * if order == 'F': # <<<<<<<<<<<<<<
19061  * for idx in range(ndim):
19062  * strides[idx] = stride
19063  */
19064  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
19065  if (__pyx_t_1) {
19066 
19067  /* "View.MemoryView":1197
19068  *
19069  * if order == 'F':
19070  * for idx in range(ndim): # <<<<<<<<<<<<<<
19071  * strides[idx] = stride
19072  * stride *= shape[idx]
19073  */
19074  __pyx_t_2 = __pyx_v_ndim;
19075  __pyx_t_3 = __pyx_t_2;
19076  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19077  __pyx_v_idx = __pyx_t_4;
19078 
19079  /* "View.MemoryView":1198
19080  * if order == 'F':
19081  * for idx in range(ndim):
19082  * strides[idx] = stride # <<<<<<<<<<<<<<
19083  * stride *= shape[idx]
19084  * else:
19085  */
19086  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19087 
19088  /* "View.MemoryView":1199
19089  * for idx in range(ndim):
19090  * strides[idx] = stride
19091  * stride *= shape[idx] # <<<<<<<<<<<<<<
19092  * else:
19093  * for idx in range(ndim - 1, -1, -1):
19094  */
19095  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19096  }
19097 
19098  /* "View.MemoryView":1196
19099  * cdef int idx
19100  *
19101  * if order == 'F': # <<<<<<<<<<<<<<
19102  * for idx in range(ndim):
19103  * strides[idx] = stride
19104  */
19105  goto __pyx_L3;
19106  }
19107 
19108  /* "View.MemoryView":1201
19109  * stride *= shape[idx]
19110  * else:
19111  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19112  * strides[idx] = stride
19113  * stride *= shape[idx]
19114  */
19115  /*else*/ {
19116  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19117  __pyx_v_idx = __pyx_t_2;
19118 
19119  /* "View.MemoryView":1202
19120  * else:
19121  * for idx in range(ndim - 1, -1, -1):
19122  * strides[idx] = stride # <<<<<<<<<<<<<<
19123  * stride *= shape[idx]
19124  *
19125  */
19126  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19127 
19128  /* "View.MemoryView":1203
19129  * for idx in range(ndim - 1, -1, -1):
19130  * strides[idx] = stride
19131  * stride *= shape[idx] # <<<<<<<<<<<<<<
19132  *
19133  * return stride
19134  */
19135  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19136  }
19137  }
19138  __pyx_L3:;
19139 
19140  /* "View.MemoryView":1205
19141  * stride *= shape[idx]
19142  *
19143  * return stride # <<<<<<<<<<<<<<
19144  *
19145  * @cname('__pyx_memoryview_copy_data_to_temp')
19146  */
19147  __pyx_r = __pyx_v_stride;
19148  goto __pyx_L0;
19149 
19150  /* "View.MemoryView":1187
19151  *
19152  * @cname('__pyx_fill_contig_strides_array')
19153  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19154  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19155  * int ndim, char order) nogil:
19156  */
19157 
19158  /* function exit code */
19159  __pyx_L0:;
19160  return __pyx_r;
19161 }
19162 
19163 /* "View.MemoryView":1208
19164  *
19165  * @cname('__pyx_memoryview_copy_data_to_temp')
19166  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19167  * __Pyx_memviewslice *tmpslice,
19168  * char order,
19169  */
19170 
19171 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
19172  int __pyx_v_i;
19173  void *__pyx_v_result;
19174  size_t __pyx_v_itemsize;
19175  size_t __pyx_v_size;
19176  void *__pyx_r;
19177  Py_ssize_t __pyx_t_1;
19178  int __pyx_t_2;
19179  int __pyx_t_3;
19180  struct __pyx_memoryview_obj *__pyx_t_4;
19181  int __pyx_t_5;
19182  int __pyx_t_6;
19183  int __pyx_lineno = 0;
19184  const char *__pyx_filename = NULL;
19185  int __pyx_clineno = 0;
19186 
19187  /* "View.MemoryView":1219
19188  * cdef void *result
19189  *
19190  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19191  * cdef size_t size = slice_get_size(src, ndim)
19192  *
19193  */
19194  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19195  __pyx_v_itemsize = __pyx_t_1;
19196 
19197  /* "View.MemoryView":1220
19198  *
19199  * cdef size_t itemsize = src.memview.view.itemsize
19200  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
19201  *
19202  * result = malloc(size)
19203  */
19204  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19205 
19206  /* "View.MemoryView":1222
19207  * cdef size_t size = slice_get_size(src, ndim)
19208  *
19209  * result = malloc(size) # <<<<<<<<<<<<<<
19210  * if not result:
19211  * _err(MemoryError, NULL)
19212  */
19213  __pyx_v_result = malloc(__pyx_v_size);
19214 
19215  /* "View.MemoryView":1223
19216  *
19217  * result = malloc(size)
19218  * if not result: # <<<<<<<<<<<<<<
19219  * _err(MemoryError, NULL)
19220  *
19221  */
19222  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19223  if (__pyx_t_2) {
19224 
19225  /* "View.MemoryView":1224
19226  * result = malloc(size)
19227  * if not result:
19228  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
19229  *
19230  *
19231  */
19232  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1224, __pyx_L1_error)
19233 
19234  /* "View.MemoryView":1223
19235  *
19236  * result = malloc(size)
19237  * if not result: # <<<<<<<<<<<<<<
19238  * _err(MemoryError, NULL)
19239  *
19240  */
19241  }
19242 
19243  /* "View.MemoryView":1227
19244  *
19245  *
19246  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
19247  * tmpslice.memview = src.memview
19248  * for i in range(ndim):
19249  */
19250  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
19251 
19252  /* "View.MemoryView":1228
19253  *
19254  * tmpslice.data = <char *> result
19255  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
19256  * for i in range(ndim):
19257  * tmpslice.shape[i] = src.shape[i]
19258  */
19259  __pyx_t_4 = __pyx_v_src->memview;
19260  __pyx_v_tmpslice->memview = __pyx_t_4;
19261 
19262  /* "View.MemoryView":1229
19263  * tmpslice.data = <char *> result
19264  * tmpslice.memview = src.memview
19265  * for i in range(ndim): # <<<<<<<<<<<<<<
19266  * tmpslice.shape[i] = src.shape[i]
19267  * tmpslice.suboffsets[i] = -1
19268  */
19269  __pyx_t_3 = __pyx_v_ndim;
19270  __pyx_t_5 = __pyx_t_3;
19271  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19272  __pyx_v_i = __pyx_t_6;
19273 
19274  /* "View.MemoryView":1230
19275  * tmpslice.memview = src.memview
19276  * for i in range(ndim):
19277  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
19278  * tmpslice.suboffsets[i] = -1
19279  *
19280  */
19281  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19282 
19283  /* "View.MemoryView":1231
19284  * for i in range(ndim):
19285  * tmpslice.shape[i] = src.shape[i]
19286  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19287  *
19288  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
19289  */
19290  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
19291  }
19292 
19293  /* "View.MemoryView":1233
19294  * tmpslice.suboffsets[i] = -1
19295  *
19296  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
19297  * ndim, order)
19298  *
19299  */
19300  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19301 
19302  /* "View.MemoryView":1237
19303  *
19304  *
19305  * for i in range(ndim): # <<<<<<<<<<<<<<
19306  * if tmpslice.shape[i] == 1:
19307  * tmpslice.strides[i] = 0
19308  */
19309  __pyx_t_3 = __pyx_v_ndim;
19310  __pyx_t_5 = __pyx_t_3;
19311  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19312  __pyx_v_i = __pyx_t_6;
19313 
19314  /* "View.MemoryView":1238
19315  *
19316  * for i in range(ndim):
19317  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19318  * tmpslice.strides[i] = 0
19319  *
19320  */
19321  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19322  if (__pyx_t_2) {
19323 
19324  /* "View.MemoryView":1239
19325  * for i in range(ndim):
19326  * if tmpslice.shape[i] == 1:
19327  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
19328  *
19329  * if slice_is_contig(src[0], order, ndim):
19330  */
19331  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19332 
19333  /* "View.MemoryView":1238
19334  *
19335  * for i in range(ndim):
19336  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19337  * tmpslice.strides[i] = 0
19338  *
19339  */
19340  }
19341  }
19342 
19343  /* "View.MemoryView":1241
19344  * tmpslice.strides[i] = 0
19345  *
19346  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19347  * memcpy(result, src.data, size)
19348  * else:
19349  */
19350  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19351  if (__pyx_t_2) {
19352 
19353  /* "View.MemoryView":1242
19354  *
19355  * if slice_is_contig(src[0], order, ndim):
19356  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
19357  * else:
19358  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19359  */
19360  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19361 
19362  /* "View.MemoryView":1241
19363  * tmpslice.strides[i] = 0
19364  *
19365  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19366  * memcpy(result, src.data, size)
19367  * else:
19368  */
19369  goto __pyx_L9;
19370  }
19371 
19372  /* "View.MemoryView":1244
19373  * memcpy(result, src.data, size)
19374  * else:
19375  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
19376  *
19377  * return result
19378  */
19379  /*else*/ {
19380  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19381  }
19382  __pyx_L9:;
19383 
19384  /* "View.MemoryView":1246
19385  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19386  *
19387  * return result # <<<<<<<<<<<<<<
19388  *
19389  *
19390  */
19391  __pyx_r = __pyx_v_result;
19392  goto __pyx_L0;
19393 
19394  /* "View.MemoryView":1208
19395  *
19396  * @cname('__pyx_memoryview_copy_data_to_temp')
19397  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19398  * __Pyx_memviewslice *tmpslice,
19399  * char order,
19400  */
19401 
19402  /* function exit code */
19403  __pyx_L1_error:;
19404  {
19405  #ifdef WITH_THREAD
19406  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19407  #endif
19408  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19409  #ifdef WITH_THREAD
19410  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19411  #endif
19412  }
19413  __pyx_r = NULL;
19414  __pyx_L0:;
19415  return __pyx_r;
19416 }
19417 
19418 /* "View.MemoryView":1251
19419  *
19420  * @cname('__pyx_memoryview_err_extents')
19421  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19422  * Py_ssize_t extent2) except -1 with gil:
19423  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19424  */
19425 
19426 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19427  int __pyx_r;
19428  __Pyx_RefNannyDeclarations
19429  PyObject *__pyx_t_1 = NULL;
19430  PyObject *__pyx_t_2 = NULL;
19431  PyObject *__pyx_t_3 = NULL;
19432  PyObject *__pyx_t_4 = NULL;
19433  int __pyx_lineno = 0;
19434  const char *__pyx_filename = NULL;
19435  int __pyx_clineno = 0;
19436  #ifdef WITH_THREAD
19437  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19438  #endif
19439  __Pyx_RefNannySetupContext("_err_extents", 0);
19440 
19441  /* "View.MemoryView":1254
19442  * Py_ssize_t extent2) except -1 with gil:
19443  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19444  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
19445  *
19446  * @cname('__pyx_memoryview_err_dim')
19447  */
19448  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error)
19449  __Pyx_GOTREF(__pyx_t_1);
19450  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1254, __pyx_L1_error)
19451  __Pyx_GOTREF(__pyx_t_2);
19452  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1254, __pyx_L1_error)
19453  __Pyx_GOTREF(__pyx_t_3);
19454  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1254, __pyx_L1_error)
19455  __Pyx_GOTREF(__pyx_t_4);
19456  __Pyx_GIVEREF(__pyx_t_1);
19457  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19458  __Pyx_GIVEREF(__pyx_t_2);
19459  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19460  __Pyx_GIVEREF(__pyx_t_3);
19461  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19462  __pyx_t_1 = 0;
19463  __pyx_t_2 = 0;
19464  __pyx_t_3 = 0;
19465 
19466  /* "View.MemoryView":1253
19467  * cdef int _err_extents(int i, Py_ssize_t extent1,
19468  * Py_ssize_t extent2) except -1 with gil:
19469  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
19470  * (i, extent1, extent2))
19471  *
19472  */
19473  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1253, __pyx_L1_error)
19474  __Pyx_GOTREF(__pyx_t_3);
19475  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19476  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1253, __pyx_L1_error)
19477  __Pyx_GOTREF(__pyx_t_4);
19478  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19479  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19480  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19481  __PYX_ERR(2, 1253, __pyx_L1_error)
19482 
19483  /* "View.MemoryView":1251
19484  *
19485  * @cname('__pyx_memoryview_err_extents')
19486  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19487  * Py_ssize_t extent2) except -1 with gil:
19488  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19489  */
19490 
19491  /* function exit code */
19492  __pyx_L1_error:;
19493  __Pyx_XDECREF(__pyx_t_1);
19494  __Pyx_XDECREF(__pyx_t_2);
19495  __Pyx_XDECREF(__pyx_t_3);
19496  __Pyx_XDECREF(__pyx_t_4);
19497  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19498  __pyx_r = -1;
19499  __Pyx_RefNannyFinishContext();
19500  #ifdef WITH_THREAD
19501  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19502  #endif
19503  return __pyx_r;
19504 }
19505 
19506 /* "View.MemoryView":1257
19507  *
19508  * @cname('__pyx_memoryview_err_dim')
19509  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19510  * raise error(msg.decode('ascii') % dim)
19511  *
19512  */
19513 
19514 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
19515  int __pyx_r;
19516  __Pyx_RefNannyDeclarations
19517  PyObject *__pyx_t_1 = NULL;
19518  PyObject *__pyx_t_2 = NULL;
19519  PyObject *__pyx_t_3 = NULL;
19520  PyObject *__pyx_t_4 = NULL;
19521  int __pyx_lineno = 0;
19522  const char *__pyx_filename = NULL;
19523  int __pyx_clineno = 0;
19524  #ifdef WITH_THREAD
19525  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19526  #endif
19527  __Pyx_RefNannySetupContext("_err_dim", 0);
19528  __Pyx_INCREF(__pyx_v_error);
19529 
19530  /* "View.MemoryView":1258
19531  * @cname('__pyx_memoryview_err_dim')
19532  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
19533  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
19534  *
19535  * @cname('__pyx_memoryview_err')
19536  */
19537  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1258, __pyx_L1_error)
19538  __Pyx_GOTREF(__pyx_t_2);
19539  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1258, __pyx_L1_error)
19540  __Pyx_GOTREF(__pyx_t_3);
19541  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1258, __pyx_L1_error)
19542  __Pyx_GOTREF(__pyx_t_4);
19543  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19544  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19545  __Pyx_INCREF(__pyx_v_error);
19546  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19547  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19548  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19549  if (likely(__pyx_t_2)) {
19550  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19551  __Pyx_INCREF(__pyx_t_2);
19552  __Pyx_INCREF(function);
19553  __Pyx_DECREF_SET(__pyx_t_3, function);
19554  }
19555  }
19556  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19557  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19558  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19559  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1258, __pyx_L1_error)
19560  __Pyx_GOTREF(__pyx_t_1);
19561  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19562  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19563  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19564  __PYX_ERR(2, 1258, __pyx_L1_error)
19565 
19566  /* "View.MemoryView":1257
19567  *
19568  * @cname('__pyx_memoryview_err_dim')
19569  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19570  * raise error(msg.decode('ascii') % dim)
19571  *
19572  */
19573 
19574  /* function exit code */
19575  __pyx_L1_error:;
19576  __Pyx_XDECREF(__pyx_t_1);
19577  __Pyx_XDECREF(__pyx_t_2);
19578  __Pyx_XDECREF(__pyx_t_3);
19579  __Pyx_XDECREF(__pyx_t_4);
19580  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19581  __pyx_r = -1;
19582  __Pyx_XDECREF(__pyx_v_error);
19583  __Pyx_RefNannyFinishContext();
19584  #ifdef WITH_THREAD
19585  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19586  #endif
19587  return __pyx_r;
19588 }
19589 
19590 /* "View.MemoryView":1261
19591  *
19592  * @cname('__pyx_memoryview_err')
19593  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19594  * if msg != NULL:
19595  * raise error(msg.decode('ascii'))
19596  */
19597 
19598 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
19599  int __pyx_r;
19600  __Pyx_RefNannyDeclarations
19601  int __pyx_t_1;
19602  PyObject *__pyx_t_2 = NULL;
19603  PyObject *__pyx_t_3 = NULL;
19604  PyObject *__pyx_t_4 = NULL;
19605  PyObject *__pyx_t_5 = NULL;
19606  int __pyx_lineno = 0;
19607  const char *__pyx_filename = NULL;
19608  int __pyx_clineno = 0;
19609  #ifdef WITH_THREAD
19610  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19611  #endif
19612  __Pyx_RefNannySetupContext("_err", 0);
19613  __Pyx_INCREF(__pyx_v_error);
19614 
19615  /* "View.MemoryView":1262
19616  * @cname('__pyx_memoryview_err')
19617  * cdef int _err(object error, char *msg) except -1 with gil:
19618  * if msg != NULL: # <<<<<<<<<<<<<<
19619  * raise error(msg.decode('ascii'))
19620  * else:
19621  */
19622  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19623  if (unlikely(__pyx_t_1)) {
19624 
19625  /* "View.MemoryView":1263
19626  * cdef int _err(object error, char *msg) except -1 with gil:
19627  * if msg != NULL:
19628  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
19629  * else:
19630  * raise error
19631  */
19632  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1263, __pyx_L1_error)
19633  __Pyx_GOTREF(__pyx_t_3);
19634  __Pyx_INCREF(__pyx_v_error);
19635  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19636  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19637  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19638  if (likely(__pyx_t_5)) {
19639  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19640  __Pyx_INCREF(__pyx_t_5);
19641  __Pyx_INCREF(function);
19642  __Pyx_DECREF_SET(__pyx_t_4, function);
19643  }
19644  }
19645  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
19646  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19647  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19648  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1263, __pyx_L1_error)
19649  __Pyx_GOTREF(__pyx_t_2);
19650  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19651  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19652  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19653  __PYX_ERR(2, 1263, __pyx_L1_error)
19654 
19655  /* "View.MemoryView":1262
19656  * @cname('__pyx_memoryview_err')
19657  * cdef int _err(object error, char *msg) except -1 with gil:
19658  * if msg != NULL: # <<<<<<<<<<<<<<
19659  * raise error(msg.decode('ascii'))
19660  * else:
19661  */
19662  }
19663 
19664  /* "View.MemoryView":1265
19665  * raise error(msg.decode('ascii'))
19666  * else:
19667  * raise error # <<<<<<<<<<<<<<
19668  *
19669  * @cname('__pyx_memoryview_copy_contents')
19670  */
19671  /*else*/ {
19672  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19673  __PYX_ERR(2, 1265, __pyx_L1_error)
19674  }
19675 
19676  /* "View.MemoryView":1261
19677  *
19678  * @cname('__pyx_memoryview_err')
19679  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19680  * if msg != NULL:
19681  * raise error(msg.decode('ascii'))
19682  */
19683 
19684  /* function exit code */
19685  __pyx_L1_error:;
19686  __Pyx_XDECREF(__pyx_t_2);
19687  __Pyx_XDECREF(__pyx_t_3);
19688  __Pyx_XDECREF(__pyx_t_4);
19689  __Pyx_XDECREF(__pyx_t_5);
19690  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19691  __pyx_r = -1;
19692  __Pyx_XDECREF(__pyx_v_error);
19693  __Pyx_RefNannyFinishContext();
19694  #ifdef WITH_THREAD
19695  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19696  #endif
19697  return __pyx_r;
19698 }
19699 
19700 /* "View.MemoryView":1268
19701  *
19702  * @cname('__pyx_memoryview_copy_contents')
19703  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19704  * __Pyx_memviewslice dst,
19705  * int src_ndim, int dst_ndim,
19706  */
19707 
19708 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
19709  void *__pyx_v_tmpdata;
19710  size_t __pyx_v_itemsize;
19711  int __pyx_v_i;
19712  char __pyx_v_order;
19713  int __pyx_v_broadcasting;
19714  int __pyx_v_direct_copy;
19715  __Pyx_memviewslice __pyx_v_tmp;
19716  int __pyx_v_ndim;
19717  int __pyx_r;
19718  Py_ssize_t __pyx_t_1;
19719  int __pyx_t_2;
19720  int __pyx_t_3;
19721  int __pyx_t_4;
19722  int __pyx_t_5;
19723  int __pyx_t_6;
19724  void *__pyx_t_7;
19725  int __pyx_t_8;
19726  int __pyx_lineno = 0;
19727  const char *__pyx_filename = NULL;
19728  int __pyx_clineno = 0;
19729 
19730  /* "View.MemoryView":1276
19731  * Check for overlapping memory and verify the shapes.
19732  * """
19733  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
19734  * cdef size_t itemsize = src.memview.view.itemsize
19735  * cdef int i
19736  */
19737  __pyx_v_tmpdata = NULL;
19738 
19739  /* "View.MemoryView":1277
19740  * """
19741  * cdef void *tmpdata = NULL
19742  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19743  * cdef int i
19744  * cdef char order = get_best_order(&src, src_ndim)
19745  */
19746  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19747  __pyx_v_itemsize = __pyx_t_1;
19748 
19749  /* "View.MemoryView":1279
19750  * cdef size_t itemsize = src.memview.view.itemsize
19751  * cdef int i
19752  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
19753  * cdef bint broadcasting = False
19754  * cdef bint direct_copy = False
19755  */
19756  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19757 
19758  /* "View.MemoryView":1280
19759  * cdef int i
19760  * cdef char order = get_best_order(&src, src_ndim)
19761  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
19762  * cdef bint direct_copy = False
19763  * cdef __Pyx_memviewslice tmp
19764  */
19765  __pyx_v_broadcasting = 0;
19766 
19767  /* "View.MemoryView":1281
19768  * cdef char order = get_best_order(&src, src_ndim)
19769  * cdef bint broadcasting = False
19770  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
19771  * cdef __Pyx_memviewslice tmp
19772  *
19773  */
19774  __pyx_v_direct_copy = 0;
19775 
19776  /* "View.MemoryView":1284
19777  * cdef __Pyx_memviewslice tmp
19778  *
19779  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19780  * broadcast_leading(&src, src_ndim, dst_ndim)
19781  * elif dst_ndim < src_ndim:
19782  */
19783  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19784  if (__pyx_t_2) {
19785 
19786  /* "View.MemoryView":1285
19787  *
19788  * if src_ndim < dst_ndim:
19789  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19790  * elif dst_ndim < src_ndim:
19791  * broadcast_leading(&dst, dst_ndim, src_ndim)
19792  */
19793  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19794 
19795  /* "View.MemoryView":1284
19796  * cdef __Pyx_memviewslice tmp
19797  *
19798  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19799  * broadcast_leading(&src, src_ndim, dst_ndim)
19800  * elif dst_ndim < src_ndim:
19801  */
19802  goto __pyx_L3;
19803  }
19804 
19805  /* "View.MemoryView":1286
19806  * if src_ndim < dst_ndim:
19807  * broadcast_leading(&src, src_ndim, dst_ndim)
19808  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19809  * broadcast_leading(&dst, dst_ndim, src_ndim)
19810  *
19811  */
19812  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19813  if (__pyx_t_2) {
19814 
19815  /* "View.MemoryView":1287
19816  * broadcast_leading(&src, src_ndim, dst_ndim)
19817  * elif dst_ndim < src_ndim:
19818  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
19819  *
19820  * cdef int ndim = max(src_ndim, dst_ndim)
19821  */
19822  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19823 
19824  /* "View.MemoryView":1286
19825  * if src_ndim < dst_ndim:
19826  * broadcast_leading(&src, src_ndim, dst_ndim)
19827  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19828  * broadcast_leading(&dst, dst_ndim, src_ndim)
19829  *
19830  */
19831  }
19832  __pyx_L3:;
19833 
19834  /* "View.MemoryView":1289
19835  * broadcast_leading(&dst, dst_ndim, src_ndim)
19836  *
19837  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19838  *
19839  * for i in range(ndim):
19840  */
19841  __pyx_t_3 = __pyx_v_dst_ndim;
19842  __pyx_t_4 = __pyx_v_src_ndim;
19843  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19844  __pyx_t_5 = __pyx_t_3;
19845  } else {
19846  __pyx_t_5 = __pyx_t_4;
19847  }
19848  __pyx_v_ndim = __pyx_t_5;
19849 
19850  /* "View.MemoryView":1291
19851  * cdef int ndim = max(src_ndim, dst_ndim)
19852  *
19853  * for i in range(ndim): # <<<<<<<<<<<<<<
19854  * if src.shape[i] != dst.shape[i]:
19855  * if src.shape[i] == 1:
19856  */
19857  __pyx_t_5 = __pyx_v_ndim;
19858  __pyx_t_3 = __pyx_t_5;
19859  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19860  __pyx_v_i = __pyx_t_4;
19861 
19862  /* "View.MemoryView":1292
19863  *
19864  * for i in range(ndim):
19865  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19866  * if src.shape[i] == 1:
19867  * broadcasting = True
19868  */
19869  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19870  if (__pyx_t_2) {
19871 
19872  /* "View.MemoryView":1293
19873  * for i in range(ndim):
19874  * if src.shape[i] != dst.shape[i]:
19875  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19876  * broadcasting = True
19877  * src.strides[i] = 0
19878  */
19879  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19880  if (__pyx_t_2) {
19881 
19882  /* "View.MemoryView":1294
19883  * if src.shape[i] != dst.shape[i]:
19884  * if src.shape[i] == 1:
19885  * broadcasting = True # <<<<<<<<<<<<<<
19886  * src.strides[i] = 0
19887  * else:
19888  */
19889  __pyx_v_broadcasting = 1;
19890 
19891  /* "View.MemoryView":1295
19892  * if src.shape[i] == 1:
19893  * broadcasting = True
19894  * src.strides[i] = 0 # <<<<<<<<<<<<<<
19895  * else:
19896  * _err_extents(i, dst.shape[i], src.shape[i])
19897  */
19898  (__pyx_v_src.strides[__pyx_v_i]) = 0;
19899 
19900  /* "View.MemoryView":1293
19901  * for i in range(ndim):
19902  * if src.shape[i] != dst.shape[i]:
19903  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19904  * broadcasting = True
19905  * src.strides[i] = 0
19906  */
19907  goto __pyx_L7;
19908  }
19909 
19910  /* "View.MemoryView":1297
19911  * src.strides[i] = 0
19912  * else:
19913  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
19914  *
19915  * if src.suboffsets[i] >= 0:
19916  */
19917  /*else*/ {
19918  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1297, __pyx_L1_error)
19919  }
19920  __pyx_L7:;
19921 
19922  /* "View.MemoryView":1292
19923  *
19924  * for i in range(ndim):
19925  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19926  * if src.shape[i] == 1:
19927  * broadcasting = True
19928  */
19929  }
19930 
19931  /* "View.MemoryView":1299
19932  * _err_extents(i, dst.shape[i], src.shape[i])
19933  *
19934  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19935  * _err_dim(ValueError, "Dimension %d is not direct", i)
19936  *
19937  */
19938  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19939  if (__pyx_t_2) {
19940 
19941  /* "View.MemoryView":1300
19942  *
19943  * if src.suboffsets[i] >= 0:
19944  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
19945  *
19946  * if slices_overlap(&src, &dst, ndim, itemsize):
19947  */
19948  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1300, __pyx_L1_error)
19949 
19950  /* "View.MemoryView":1299
19951  * _err_extents(i, dst.shape[i], src.shape[i])
19952  *
19953  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19954  * _err_dim(ValueError, "Dimension %d is not direct", i)
19955  *
19956  */
19957  }
19958  }
19959 
19960  /* "View.MemoryView":1302
19961  * _err_dim(ValueError, "Dimension %d is not direct", i)
19962  *
19963  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19964  *
19965  * if not slice_is_contig(src, order, ndim):
19966  */
19967  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19968  if (__pyx_t_2) {
19969 
19970  /* "View.MemoryView":1304
19971  * if slices_overlap(&src, &dst, ndim, itemsize):
19972  *
19973  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19974  * order = get_best_order(&dst, ndim)
19975  *
19976  */
19977  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19978  if (__pyx_t_2) {
19979 
19980  /* "View.MemoryView":1305
19981  *
19982  * if not slice_is_contig(src, order, ndim):
19983  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
19984  *
19985  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19986  */
19987  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19988 
19989  /* "View.MemoryView":1304
19990  * if slices_overlap(&src, &dst, ndim, itemsize):
19991  *
19992  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19993  * order = get_best_order(&dst, ndim)
19994  *
19995  */
19996  }
19997 
19998  /* "View.MemoryView":1307
19999  * order = get_best_order(&dst, ndim)
20000  *
20001  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
20002  * src = tmp
20003  *
20004  */
20005  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1307, __pyx_L1_error)
20006  __pyx_v_tmpdata = __pyx_t_7;
20007 
20008  /* "View.MemoryView":1308
20009  *
20010  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20011  * src = tmp # <<<<<<<<<<<<<<
20012  *
20013  * if not broadcasting:
20014  */
20015  __pyx_v_src = __pyx_v_tmp;
20016 
20017  /* "View.MemoryView":1302
20018  * _err_dim(ValueError, "Dimension %d is not direct", i)
20019  *
20020  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20021  *
20022  * if not slice_is_contig(src, order, ndim):
20023  */
20024  }
20025 
20026  /* "View.MemoryView":1310
20027  * src = tmp
20028  *
20029  * if not broadcasting: # <<<<<<<<<<<<<<
20030  *
20031  *
20032  */
20033  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20034  if (__pyx_t_2) {
20035 
20036  /* "View.MemoryView":1313
20037  *
20038  *
20039  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20040  * direct_copy = slice_is_contig(dst, 'C', ndim)
20041  * elif slice_is_contig(src, 'F', ndim):
20042  */
20043  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
20044  if (__pyx_t_2) {
20045 
20046  /* "View.MemoryView":1314
20047  *
20048  * if slice_is_contig(src, 'C', ndim):
20049  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
20050  * elif slice_is_contig(src, 'F', ndim):
20051  * direct_copy = slice_is_contig(dst, 'F', ndim)
20052  */
20053  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
20054 
20055  /* "View.MemoryView":1313
20056  *
20057  *
20058  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20059  * direct_copy = slice_is_contig(dst, 'C', ndim)
20060  * elif slice_is_contig(src, 'F', ndim):
20061  */
20062  goto __pyx_L12;
20063  }
20064 
20065  /* "View.MemoryView":1315
20066  * if slice_is_contig(src, 'C', ndim):
20067  * direct_copy = slice_is_contig(dst, 'C', ndim)
20068  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20069  * direct_copy = slice_is_contig(dst, 'F', ndim)
20070  *
20071  */
20072  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
20073  if (__pyx_t_2) {
20074 
20075  /* "View.MemoryView":1316
20076  * direct_copy = slice_is_contig(dst, 'C', ndim)
20077  * elif slice_is_contig(src, 'F', ndim):
20078  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
20079  *
20080  * if direct_copy:
20081  */
20082  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
20083 
20084  /* "View.MemoryView":1315
20085  * if slice_is_contig(src, 'C', ndim):
20086  * direct_copy = slice_is_contig(dst, 'C', ndim)
20087  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20088  * direct_copy = slice_is_contig(dst, 'F', ndim)
20089  *
20090  */
20091  }
20092  __pyx_L12:;
20093 
20094  /* "View.MemoryView":1318
20095  * direct_copy = slice_is_contig(dst, 'F', ndim)
20096  *
20097  * if direct_copy: # <<<<<<<<<<<<<<
20098  *
20099  * refcount_copying(&dst, dtype_is_object, ndim, False)
20100  */
20101  __pyx_t_2 = (__pyx_v_direct_copy != 0);
20102  if (__pyx_t_2) {
20103 
20104  /* "View.MemoryView":1320
20105  * if direct_copy:
20106  *
20107  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20108  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20109  * refcount_copying(&dst, dtype_is_object, ndim, True)
20110  */
20111  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20112 
20113  /* "View.MemoryView":1321
20114  *
20115  * refcount_copying(&dst, dtype_is_object, ndim, False)
20116  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
20117  * refcount_copying(&dst, dtype_is_object, ndim, True)
20118  * free(tmpdata)
20119  */
20120  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20121 
20122  /* "View.MemoryView":1322
20123  * refcount_copying(&dst, dtype_is_object, ndim, False)
20124  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20125  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20126  * free(tmpdata)
20127  * return 0
20128  */
20129  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20130 
20131  /* "View.MemoryView":1323
20132  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20133  * refcount_copying(&dst, dtype_is_object, ndim, True)
20134  * free(tmpdata) # <<<<<<<<<<<<<<
20135  * return 0
20136  *
20137  */
20138  free(__pyx_v_tmpdata);
20139 
20140  /* "View.MemoryView":1324
20141  * refcount_copying(&dst, dtype_is_object, ndim, True)
20142  * free(tmpdata)
20143  * return 0 # <<<<<<<<<<<<<<
20144  *
20145  * if order == 'F' == get_best_order(&dst, ndim):
20146  */
20147  __pyx_r = 0;
20148  goto __pyx_L0;
20149 
20150  /* "View.MemoryView":1318
20151  * direct_copy = slice_is_contig(dst, 'F', ndim)
20152  *
20153  * if direct_copy: # <<<<<<<<<<<<<<
20154  *
20155  * refcount_copying(&dst, dtype_is_object, ndim, False)
20156  */
20157  }
20158 
20159  /* "View.MemoryView":1310
20160  * src = tmp
20161  *
20162  * if not broadcasting: # <<<<<<<<<<<<<<
20163  *
20164  *
20165  */
20166  }
20167 
20168  /* "View.MemoryView":1326
20169  * return 0
20170  *
20171  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20172  *
20173  *
20174  */
20175  __pyx_t_2 = (__pyx_v_order == 'F');
20176  if (__pyx_t_2) {
20177  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20178  }
20179  __pyx_t_8 = (__pyx_t_2 != 0);
20180  if (__pyx_t_8) {
20181 
20182  /* "View.MemoryView":1329
20183  *
20184  *
20185  * transpose_memslice(&src) # <<<<<<<<<<<<<<
20186  * transpose_memslice(&dst)
20187  *
20188  */
20189  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1329, __pyx_L1_error)
20190 
20191  /* "View.MemoryView":1330
20192  *
20193  * transpose_memslice(&src)
20194  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
20195  *
20196  * refcount_copying(&dst, dtype_is_object, ndim, False)
20197  */
20198  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1330, __pyx_L1_error)
20199 
20200  /* "View.MemoryView":1326
20201  * return 0
20202  *
20203  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20204  *
20205  *
20206  */
20207  }
20208 
20209  /* "View.MemoryView":1332
20210  * transpose_memslice(&dst)
20211  *
20212  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20213  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20214  * refcount_copying(&dst, dtype_is_object, ndim, True)
20215  */
20216  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20217 
20218  /* "View.MemoryView":1333
20219  *
20220  * refcount_copying(&dst, dtype_is_object, ndim, False)
20221  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
20222  * refcount_copying(&dst, dtype_is_object, ndim, True)
20223  *
20224  */
20225  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20226 
20227  /* "View.MemoryView":1334
20228  * refcount_copying(&dst, dtype_is_object, ndim, False)
20229  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20230  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20231  *
20232  * free(tmpdata)
20233  */
20234  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20235 
20236  /* "View.MemoryView":1336
20237  * refcount_copying(&dst, dtype_is_object, ndim, True)
20238  *
20239  * free(tmpdata) # <<<<<<<<<<<<<<
20240  * return 0
20241  *
20242  */
20243  free(__pyx_v_tmpdata);
20244 
20245  /* "View.MemoryView":1337
20246  *
20247  * free(tmpdata)
20248  * return 0 # <<<<<<<<<<<<<<
20249  *
20250  * @cname('__pyx_memoryview_broadcast_leading')
20251  */
20252  __pyx_r = 0;
20253  goto __pyx_L0;
20254 
20255  /* "View.MemoryView":1268
20256  *
20257  * @cname('__pyx_memoryview_copy_contents')
20258  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20259  * __Pyx_memviewslice dst,
20260  * int src_ndim, int dst_ndim,
20261  */
20262 
20263  /* function exit code */
20264  __pyx_L1_error:;
20265  {
20266  #ifdef WITH_THREAD
20267  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20268  #endif
20269  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20270  #ifdef WITH_THREAD
20271  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20272  #endif
20273  }
20274  __pyx_r = -1;
20275  __pyx_L0:;
20276  return __pyx_r;
20277 }
20278 
20279 /* "View.MemoryView":1340
20280  *
20281  * @cname('__pyx_memoryview_broadcast_leading')
20282  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20283  * int ndim,
20284  * int ndim_other) nogil:
20285  */
20286 
20287 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
20288  int __pyx_v_i;
20289  int __pyx_v_offset;
20290  int __pyx_t_1;
20291  int __pyx_t_2;
20292  int __pyx_t_3;
20293 
20294  /* "View.MemoryView":1344
20295  * int ndim_other) nogil:
20296  * cdef int i
20297  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
20298  *
20299  * for i in range(ndim - 1, -1, -1):
20300  */
20301  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20302 
20303  /* "View.MemoryView":1346
20304  * cdef int offset = ndim_other - ndim
20305  *
20306  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20307  * mslice.shape[i + offset] = mslice.shape[i]
20308  * mslice.strides[i + offset] = mslice.strides[i]
20309  */
20310  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20311  __pyx_v_i = __pyx_t_1;
20312 
20313  /* "View.MemoryView":1347
20314  *
20315  * for i in range(ndim - 1, -1, -1):
20316  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
20317  * mslice.strides[i + offset] = mslice.strides[i]
20318  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20319  */
20320  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20321 
20322  /* "View.MemoryView":1348
20323  * for i in range(ndim - 1, -1, -1):
20324  * mslice.shape[i + offset] = mslice.shape[i]
20325  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
20326  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20327  *
20328  */
20329  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20330 
20331  /* "View.MemoryView":1349
20332  * mslice.shape[i + offset] = mslice.shape[i]
20333  * mslice.strides[i + offset] = mslice.strides[i]
20334  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
20335  *
20336  * for i in range(offset):
20337  */
20338  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20339  }
20340 
20341  /* "View.MemoryView":1351
20342  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20343  *
20344  * for i in range(offset): # <<<<<<<<<<<<<<
20345  * mslice.shape[i] = 1
20346  * mslice.strides[i] = mslice.strides[0]
20347  */
20348  __pyx_t_1 = __pyx_v_offset;
20349  __pyx_t_2 = __pyx_t_1;
20350  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20351  __pyx_v_i = __pyx_t_3;
20352 
20353  /* "View.MemoryView":1352
20354  *
20355  * for i in range(offset):
20356  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
20357  * mslice.strides[i] = mslice.strides[0]
20358  * mslice.suboffsets[i] = -1
20359  */
20360  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20361 
20362  /* "View.MemoryView":1353
20363  * for i in range(offset):
20364  * mslice.shape[i] = 1
20365  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
20366  * mslice.suboffsets[i] = -1
20367  *
20368  */
20369  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20370 
20371  /* "View.MemoryView":1354
20372  * mslice.shape[i] = 1
20373  * mslice.strides[i] = mslice.strides[0]
20374  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20375  *
20376  *
20377  */
20378  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20379  }
20380 
20381  /* "View.MemoryView":1340
20382  *
20383  * @cname('__pyx_memoryview_broadcast_leading')
20384  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20385  * int ndim,
20386  * int ndim_other) nogil:
20387  */
20388 
20389  /* function exit code */
20390 }
20391 
20392 /* "View.MemoryView":1362
20393  *
20394  * @cname('__pyx_memoryview_refcount_copying')
20395  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20396  * int ndim, bint inc) nogil:
20397  *
20398  */
20399 
20400 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
20401  int __pyx_t_1;
20402 
20403  /* "View.MemoryView":1366
20404  *
20405  *
20406  * if dtype_is_object: # <<<<<<<<<<<<<<
20407  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20408  * dst.strides, ndim, inc)
20409  */
20410  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20411  if (__pyx_t_1) {
20412 
20413  /* "View.MemoryView":1367
20414  *
20415  * if dtype_is_object:
20416  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
20417  * dst.strides, ndim, inc)
20418  *
20419  */
20420  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20421 
20422  /* "View.MemoryView":1366
20423  *
20424  *
20425  * if dtype_is_object: # <<<<<<<<<<<<<<
20426  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20427  * dst.strides, ndim, inc)
20428  */
20429  }
20430 
20431  /* "View.MemoryView":1362
20432  *
20433  * @cname('__pyx_memoryview_refcount_copying')
20434  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20435  * int ndim, bint inc) nogil:
20436  *
20437  */
20438 
20439  /* function exit code */
20440 }
20441 
20442 /* "View.MemoryView":1371
20443  *
20444  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20445  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20446  * Py_ssize_t *strides, int ndim,
20447  * bint inc) with gil:
20448  */
20449 
20450 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20451  __Pyx_RefNannyDeclarations
20452  #ifdef WITH_THREAD
20453  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20454  #endif
20455  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
20456 
20457  /* "View.MemoryView":1374
20458  * Py_ssize_t *strides, int ndim,
20459  * bint inc) with gil:
20460  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
20461  *
20462  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20463  */
20464  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20465 
20466  /* "View.MemoryView":1371
20467  *
20468  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20469  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20470  * Py_ssize_t *strides, int ndim,
20471  * bint inc) with gil:
20472  */
20473 
20474  /* function exit code */
20475  __Pyx_RefNannyFinishContext();
20476  #ifdef WITH_THREAD
20477  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20478  #endif
20479 }
20480 
20481 /* "View.MemoryView":1377
20482  *
20483  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20484  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20485  * Py_ssize_t *strides, int ndim, bint inc):
20486  * cdef Py_ssize_t i
20487  */
20488 
20489 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20490  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20491  __Pyx_RefNannyDeclarations
20492  Py_ssize_t __pyx_t_1;
20493  Py_ssize_t __pyx_t_2;
20494  Py_ssize_t __pyx_t_3;
20495  int __pyx_t_4;
20496  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
20497 
20498  /* "View.MemoryView":1381
20499  * cdef Py_ssize_t i
20500  *
20501  * for i in range(shape[0]): # <<<<<<<<<<<<<<
20502  * if ndim == 1:
20503  * if inc:
20504  */
20505  __pyx_t_1 = (__pyx_v_shape[0]);
20506  __pyx_t_2 = __pyx_t_1;
20507  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20508  __pyx_v_i = __pyx_t_3;
20509 
20510  /* "View.MemoryView":1382
20511  *
20512  * for i in range(shape[0]):
20513  * if ndim == 1: # <<<<<<<<<<<<<<
20514  * if inc:
20515  * Py_INCREF((<PyObject **> data)[0])
20516  */
20517  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20518  if (__pyx_t_4) {
20519 
20520  /* "View.MemoryView":1383
20521  * for i in range(shape[0]):
20522  * if ndim == 1:
20523  * if inc: # <<<<<<<<<<<<<<
20524  * Py_INCREF((<PyObject **> data)[0])
20525  * else:
20526  */
20527  __pyx_t_4 = (__pyx_v_inc != 0);
20528  if (__pyx_t_4) {
20529 
20530  /* "View.MemoryView":1384
20531  * if ndim == 1:
20532  * if inc:
20533  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20534  * else:
20535  * Py_DECREF((<PyObject **> data)[0])
20536  */
20537  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20538 
20539  /* "View.MemoryView":1383
20540  * for i in range(shape[0]):
20541  * if ndim == 1:
20542  * if inc: # <<<<<<<<<<<<<<
20543  * Py_INCREF((<PyObject **> data)[0])
20544  * else:
20545  */
20546  goto __pyx_L6;
20547  }
20548 
20549  /* "View.MemoryView":1386
20550  * Py_INCREF((<PyObject **> data)[0])
20551  * else:
20552  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20553  * else:
20554  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20555  */
20556  /*else*/ {
20557  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20558  }
20559  __pyx_L6:;
20560 
20561  /* "View.MemoryView":1382
20562  *
20563  * for i in range(shape[0]):
20564  * if ndim == 1: # <<<<<<<<<<<<<<
20565  * if inc:
20566  * Py_INCREF((<PyObject **> data)[0])
20567  */
20568  goto __pyx_L5;
20569  }
20570 
20571  /* "View.MemoryView":1388
20572  * Py_DECREF((<PyObject **> data)[0])
20573  * else:
20574  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20575  * ndim - 1, inc)
20576  *
20577  */
20578  /*else*/ {
20579 
20580  /* "View.MemoryView":1389
20581  * else:
20582  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20583  * ndim - 1, inc) # <<<<<<<<<<<<<<
20584  *
20585  * data += strides[0]
20586  */
20587  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20588  }
20589  __pyx_L5:;
20590 
20591  /* "View.MemoryView":1391
20592  * ndim - 1, inc)
20593  *
20594  * data += strides[0] # <<<<<<<<<<<<<<
20595  *
20596  *
20597  */
20598  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20599  }
20600 
20601  /* "View.MemoryView":1377
20602  *
20603  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20604  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20605  * Py_ssize_t *strides, int ndim, bint inc):
20606  * cdef Py_ssize_t i
20607  */
20608 
20609  /* function exit code */
20610  __Pyx_RefNannyFinishContext();
20611 }
20612 
20613 /* "View.MemoryView":1397
20614  *
20615  * @cname('__pyx_memoryview_slice_assign_scalar')
20616  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20617  * size_t itemsize, void *item,
20618  * bint dtype_is_object) nogil:
20619  */
20620 
20621 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
20622 
20623  /* "View.MemoryView":1400
20624  * size_t itemsize, void *item,
20625  * bint dtype_is_object) nogil:
20626  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20627  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20628  * itemsize, item)
20629  */
20630  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20631 
20632  /* "View.MemoryView":1401
20633  * bint dtype_is_object) nogil:
20634  * refcount_copying(dst, dtype_is_object, ndim, False)
20635  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
20636  * itemsize, item)
20637  * refcount_copying(dst, dtype_is_object, ndim, True)
20638  */
20639  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20640 
20641  /* "View.MemoryView":1403
20642  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20643  * itemsize, item)
20644  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20645  *
20646  *
20647  */
20648  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20649 
20650  /* "View.MemoryView":1397
20651  *
20652  * @cname('__pyx_memoryview_slice_assign_scalar')
20653  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20654  * size_t itemsize, void *item,
20655  * bint dtype_is_object) nogil:
20656  */
20657 
20658  /* function exit code */
20659 }
20660 
20661 /* "View.MemoryView":1407
20662  *
20663  * @cname('__pyx_memoryview__slice_assign_scalar')
20664  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20665  * Py_ssize_t *strides, int ndim,
20666  * size_t itemsize, void *item) nogil:
20667  */
20668 
20669 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
20670  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20671  Py_ssize_t __pyx_v_stride;
20672  Py_ssize_t __pyx_v_extent;
20673  int __pyx_t_1;
20674  Py_ssize_t __pyx_t_2;
20675  Py_ssize_t __pyx_t_3;
20676  Py_ssize_t __pyx_t_4;
20677 
20678  /* "View.MemoryView":1411
20679  * size_t itemsize, void *item) nogil:
20680  * cdef Py_ssize_t i
20681  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
20682  * cdef Py_ssize_t extent = shape[0]
20683  *
20684  */
20685  __pyx_v_stride = (__pyx_v_strides[0]);
20686 
20687  /* "View.MemoryView":1412
20688  * cdef Py_ssize_t i
20689  * cdef Py_ssize_t stride = strides[0]
20690  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
20691  *
20692  * if ndim == 1:
20693  */
20694  __pyx_v_extent = (__pyx_v_shape[0]);
20695 
20696  /* "View.MemoryView":1414
20697  * cdef Py_ssize_t extent = shape[0]
20698  *
20699  * if ndim == 1: # <<<<<<<<<<<<<<
20700  * for i in range(extent):
20701  * memcpy(data, item, itemsize)
20702  */
20703  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20704  if (__pyx_t_1) {
20705 
20706  /* "View.MemoryView":1415
20707  *
20708  * if ndim == 1:
20709  * for i in range(extent): # <<<<<<<<<<<<<<
20710  * memcpy(data, item, itemsize)
20711  * data += stride
20712  */
20713  __pyx_t_2 = __pyx_v_extent;
20714  __pyx_t_3 = __pyx_t_2;
20715  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20716  __pyx_v_i = __pyx_t_4;
20717 
20718  /* "View.MemoryView":1416
20719  * if ndim == 1:
20720  * for i in range(extent):
20721  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
20722  * data += stride
20723  * else:
20724  */
20725  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20726 
20727  /* "View.MemoryView":1417
20728  * for i in range(extent):
20729  * memcpy(data, item, itemsize)
20730  * data += stride # <<<<<<<<<<<<<<
20731  * else:
20732  * for i in range(extent):
20733  */
20734  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20735  }
20736 
20737  /* "View.MemoryView":1414
20738  * cdef Py_ssize_t extent = shape[0]
20739  *
20740  * if ndim == 1: # <<<<<<<<<<<<<<
20741  * for i in range(extent):
20742  * memcpy(data, item, itemsize)
20743  */
20744  goto __pyx_L3;
20745  }
20746 
20747  /* "View.MemoryView":1419
20748  * data += stride
20749  * else:
20750  * for i in range(extent): # <<<<<<<<<<<<<<
20751  * _slice_assign_scalar(data, shape + 1, strides + 1,
20752  * ndim - 1, itemsize, item)
20753  */
20754  /*else*/ {
20755  __pyx_t_2 = __pyx_v_extent;
20756  __pyx_t_3 = __pyx_t_2;
20757  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20758  __pyx_v_i = __pyx_t_4;
20759 
20760  /* "View.MemoryView":1420
20761  * else:
20762  * for i in range(extent):
20763  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20764  * ndim - 1, itemsize, item)
20765  * data += stride
20766  */
20767  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20768 
20769  /* "View.MemoryView":1422
20770  * _slice_assign_scalar(data, shape + 1, strides + 1,
20771  * ndim - 1, itemsize, item)
20772  * data += stride # <<<<<<<<<<<<<<
20773  *
20774  *
20775  */
20776  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20777  }
20778  }
20779  __pyx_L3:;
20780 
20781  /* "View.MemoryView":1407
20782  *
20783  * @cname('__pyx_memoryview__slice_assign_scalar')
20784  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20785  * Py_ssize_t *strides, int ndim,
20786  * size_t itemsize, void *item) nogil:
20787  */
20788 
20789  /* function exit code */
20790 }
20791 
20792 /* "(tree fragment)":1
20793  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20794  * cdef object __pyx_PickleError
20795  * cdef object __pyx_result
20796  */
20797 
20798 /* Python wrapper */
20799 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20800 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20801 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20802  PyObject *__pyx_v___pyx_type = 0;
20803  long __pyx_v___pyx_checksum;
20804  PyObject *__pyx_v___pyx_state = 0;
20805  int __pyx_lineno = 0;
20806  const char *__pyx_filename = NULL;
20807  int __pyx_clineno = 0;
20808  PyObject *__pyx_r = 0;
20809  __Pyx_RefNannyDeclarations
20810  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
20811  {
20812  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20813  PyObject* values[3] = {0,0,0};
20814  if (unlikely(__pyx_kwds)) {
20815  Py_ssize_t kw_args;
20816  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20817  switch (pos_args) {
20818  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20819  CYTHON_FALLTHROUGH;
20820  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20821  CYTHON_FALLTHROUGH;
20822  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20823  CYTHON_FALLTHROUGH;
20824  case 0: break;
20825  default: goto __pyx_L5_argtuple_error;
20826  }
20827  kw_args = PyDict_Size(__pyx_kwds);
20828  switch (pos_args) {
20829  case 0:
20830  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20831  else goto __pyx_L5_argtuple_error;
20832  CYTHON_FALLTHROUGH;
20833  case 1:
20834  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20835  else {
20836  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
20837  }
20838  CYTHON_FALLTHROUGH;
20839  case 2:
20840  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20841  else {
20842  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
20843  }
20844  }
20845  if (unlikely(kw_args > 0)) {
20846  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
20847  }
20848  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20849  goto __pyx_L5_argtuple_error;
20850  } else {
20851  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20852  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20853  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20854  }
20855  __pyx_v___pyx_type = values[0];
20856  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
20857  __pyx_v___pyx_state = values[2];
20858  }
20859  goto __pyx_L4_argument_unpacking_done;
20860  __pyx_L5_argtuple_error:;
20861  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
20862  __pyx_L3_error:;
20863  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20864  __Pyx_RefNannyFinishContext();
20865  return NULL;
20866  __pyx_L4_argument_unpacking_done:;
20867  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20868 
20869  /* function exit code */
20870  __Pyx_RefNannyFinishContext();
20871  return __pyx_r;
20872 }
20873 
20874 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20875  PyObject *__pyx_v___pyx_PickleError = 0;
20876  PyObject *__pyx_v___pyx_result = 0;
20877  PyObject *__pyx_r = NULL;
20878  __Pyx_RefNannyDeclarations
20879  int __pyx_t_1;
20880  PyObject *__pyx_t_2 = NULL;
20881  PyObject *__pyx_t_3 = NULL;
20882  PyObject *__pyx_t_4 = NULL;
20883  PyObject *__pyx_t_5 = NULL;
20884  int __pyx_t_6;
20885  int __pyx_lineno = 0;
20886  const char *__pyx_filename = NULL;
20887  int __pyx_clineno = 0;
20888  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
20889 
20890  /* "(tree fragment)":4
20891  * cdef object __pyx_PickleError
20892  * cdef object __pyx_result
20893  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20894  * from pickle import PickleError as __pyx_PickleError
20895  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20896  */
20897  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
20898  if (__pyx_t_1) {
20899 
20900  /* "(tree fragment)":5
20901  * cdef object __pyx_result
20902  * if __pyx_checksum != 0xb068931:
20903  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
20904  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20905  * __pyx_result = Enum.__new__(__pyx_type)
20906  */
20907  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
20908  __Pyx_GOTREF(__pyx_t_2);
20909  __Pyx_INCREF(__pyx_n_s_PickleError);
20910  __Pyx_GIVEREF(__pyx_n_s_PickleError);
20911  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
20912  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
20913  __Pyx_GOTREF(__pyx_t_3);
20914  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20915  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
20916  __Pyx_GOTREF(__pyx_t_2);
20917  __Pyx_INCREF(__pyx_t_2);
20918  __pyx_v___pyx_PickleError = __pyx_t_2;
20919  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20920  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20921 
20922  /* "(tree fragment)":6
20923  * if __pyx_checksum != 0xb068931:
20924  * from pickle import PickleError as __pyx_PickleError
20925  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
20926  * __pyx_result = Enum.__new__(__pyx_type)
20927  * if __pyx_state is not None:
20928  */
20929  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
20930  __Pyx_GOTREF(__pyx_t_2);
20931  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
20932  __Pyx_GOTREF(__pyx_t_4);
20933  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20934  __Pyx_INCREF(__pyx_v___pyx_PickleError);
20935  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
20936  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20937  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
20938  if (likely(__pyx_t_5)) {
20939  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20940  __Pyx_INCREF(__pyx_t_5);
20941  __Pyx_INCREF(function);
20942  __Pyx_DECREF_SET(__pyx_t_2, function);
20943  }
20944  }
20945  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
20946  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20947  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20948  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
20949  __Pyx_GOTREF(__pyx_t_3);
20950  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20951  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20952  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20953  __PYX_ERR(2, 6, __pyx_L1_error)
20954 
20955  /* "(tree fragment)":4
20956  * cdef object __pyx_PickleError
20957  * cdef object __pyx_result
20958  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20959  * from pickle import PickleError as __pyx_PickleError
20960  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20961  */
20962  }
20963 
20964  /* "(tree fragment)":7
20965  * from pickle import PickleError as __pyx_PickleError
20966  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20967  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
20968  * if __pyx_state is not None:
20969  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20970  */
20971  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
20972  __Pyx_GOTREF(__pyx_t_2);
20973  __pyx_t_4 = NULL;
20974  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
20975  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
20976  if (likely(__pyx_t_4)) {
20977  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20978  __Pyx_INCREF(__pyx_t_4);
20979  __Pyx_INCREF(function);
20980  __Pyx_DECREF_SET(__pyx_t_2, function);
20981  }
20982  }
20983  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
20984  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20985  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
20986  __Pyx_GOTREF(__pyx_t_3);
20987  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20988  __pyx_v___pyx_result = __pyx_t_3;
20989  __pyx_t_3 = 0;
20990 
20991  /* "(tree fragment)":8
20992  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20993  * __pyx_result = Enum.__new__(__pyx_type)
20994  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20995  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20996  * return __pyx_result
20997  */
20998  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
20999  __pyx_t_6 = (__pyx_t_1 != 0);
21000  if (__pyx_t_6) {
21001 
21002  /* "(tree fragment)":9
21003  * __pyx_result = Enum.__new__(__pyx_type)
21004  * if __pyx_state is not None:
21005  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
21006  * return __pyx_result
21007  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21008  */
21009  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
21010  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
21011  __Pyx_GOTREF(__pyx_t_3);
21012  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21013 
21014  /* "(tree fragment)":8
21015  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21016  * __pyx_result = Enum.__new__(__pyx_type)
21017  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21018  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21019  * return __pyx_result
21020  */
21021  }
21022 
21023  /* "(tree fragment)":10
21024  * if __pyx_state is not None:
21025  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21026  * return __pyx_result # <<<<<<<<<<<<<<
21027  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21028  * __pyx_result.name = __pyx_state[0]
21029  */
21030  __Pyx_XDECREF(__pyx_r);
21031  __Pyx_INCREF(__pyx_v___pyx_result);
21032  __pyx_r = __pyx_v___pyx_result;
21033  goto __pyx_L0;
21034 
21035  /* "(tree fragment)":1
21036  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21037  * cdef object __pyx_PickleError
21038  * cdef object __pyx_result
21039  */
21040 
21041  /* function exit code */
21042  __pyx_L1_error:;
21043  __Pyx_XDECREF(__pyx_t_2);
21044  __Pyx_XDECREF(__pyx_t_3);
21045  __Pyx_XDECREF(__pyx_t_4);
21046  __Pyx_XDECREF(__pyx_t_5);
21047  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21048  __pyx_r = NULL;
21049  __pyx_L0:;
21050  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21051  __Pyx_XDECREF(__pyx_v___pyx_result);
21052  __Pyx_XGIVEREF(__pyx_r);
21053  __Pyx_RefNannyFinishContext();
21054  return __pyx_r;
21055 }
21056 
21057 /* "(tree fragment)":11
21058  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21059  * return __pyx_result
21060  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21061  * __pyx_result.name = __pyx_state[0]
21062  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21063  */
21064 
21065 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21066  PyObject *__pyx_r = NULL;
21067  __Pyx_RefNannyDeclarations
21068  PyObject *__pyx_t_1 = NULL;
21069  int __pyx_t_2;
21070  Py_ssize_t __pyx_t_3;
21071  int __pyx_t_4;
21072  int __pyx_t_5;
21073  PyObject *__pyx_t_6 = NULL;
21074  PyObject *__pyx_t_7 = NULL;
21075  PyObject *__pyx_t_8 = NULL;
21076  int __pyx_lineno = 0;
21077  const char *__pyx_filename = NULL;
21078  int __pyx_clineno = 0;
21079  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
21080 
21081  /* "(tree fragment)":12
21082  * return __pyx_result
21083  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21084  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
21085  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21086  * __pyx_result.__dict__.update(__pyx_state[1])
21087  */
21088  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21089  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21090  __PYX_ERR(2, 12, __pyx_L1_error)
21091  }
21092  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
21093  __Pyx_GOTREF(__pyx_t_1);
21094  __Pyx_GIVEREF(__pyx_t_1);
21095  __Pyx_GOTREF(__pyx_v___pyx_result->name);
21096  __Pyx_DECREF(__pyx_v___pyx_result->name);
21097  __pyx_v___pyx_result->name = __pyx_t_1;
21098  __pyx_t_1 = 0;
21099 
21100  /* "(tree fragment)":13
21101  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21102  * __pyx_result.name = __pyx_state[0]
21103  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21104  * __pyx_result.__dict__.update(__pyx_state[1])
21105  */
21106  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21107  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21108  __PYX_ERR(2, 13, __pyx_L1_error)
21109  }
21110  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
21111  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21112  if (__pyx_t_4) {
21113  } else {
21114  __pyx_t_2 = __pyx_t_4;
21115  goto __pyx_L4_bool_binop_done;
21116  }
21117  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
21118  __pyx_t_5 = (__pyx_t_4 != 0);
21119  __pyx_t_2 = __pyx_t_5;
21120  __pyx_L4_bool_binop_done:;
21121  if (__pyx_t_2) {
21122 
21123  /* "(tree fragment)":14
21124  * __pyx_result.name = __pyx_state[0]
21125  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21126  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
21127  */
21128  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
21129  __Pyx_GOTREF(__pyx_t_6);
21130  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
21131  __Pyx_GOTREF(__pyx_t_7);
21132  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21133  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21134  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21135  __PYX_ERR(2, 14, __pyx_L1_error)
21136  }
21137  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
21138  __Pyx_GOTREF(__pyx_t_6);
21139  __pyx_t_8 = NULL;
21140  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21141  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21142  if (likely(__pyx_t_8)) {
21143  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21144  __Pyx_INCREF(__pyx_t_8);
21145  __Pyx_INCREF(function);
21146  __Pyx_DECREF_SET(__pyx_t_7, function);
21147  }
21148  }
21149  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21150  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21151  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21152  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
21153  __Pyx_GOTREF(__pyx_t_1);
21154  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21155  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21156 
21157  /* "(tree fragment)":13
21158  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21159  * __pyx_result.name = __pyx_state[0]
21160  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21161  * __pyx_result.__dict__.update(__pyx_state[1])
21162  */
21163  }
21164 
21165  /* "(tree fragment)":11
21166  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21167  * return __pyx_result
21168  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21169  * __pyx_result.name = __pyx_state[0]
21170  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21171  */
21172 
21173  /* function exit code */
21174  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21175  goto __pyx_L0;
21176  __pyx_L1_error:;
21177  __Pyx_XDECREF(__pyx_t_1);
21178  __Pyx_XDECREF(__pyx_t_6);
21179  __Pyx_XDECREF(__pyx_t_7);
21180  __Pyx_XDECREF(__pyx_t_8);
21181  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21182  __pyx_r = 0;
21183  __pyx_L0:;
21184  __Pyx_XGIVEREF(__pyx_r);
21185  __Pyx_RefNannyFinishContext();
21186  return __pyx_r;
21187 }
21188 
21189 /* "BufferFormatFromTypeInfo":1463
21190  *
21191  * @cname('__pyx_format_from_typeinfo')
21192  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
21193  * cdef __Pyx_StructField *field
21194  * cdef __pyx_typeinfo_string fmt
21195  */
21196 
21197 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) {
21198  __Pyx_StructField *__pyx_v_field;
21199  struct __pyx_typeinfo_string __pyx_v_fmt;
21200  PyObject *__pyx_v_part = 0;
21201  PyObject *__pyx_v_result = 0;
21202  PyObject *__pyx_v_alignment = NULL;
21203  PyObject *__pyx_v_parts = NULL;
21204  PyObject *__pyx_v_extents = NULL;
21205  int __pyx_v_i;
21206  PyObject *__pyx_r = NULL;
21207  __Pyx_RefNannyDeclarations
21208  int __pyx_t_1;
21209  int __pyx_t_2;
21210  PyObject *__pyx_t_3 = NULL;
21211  __Pyx_StructField *__pyx_t_4;
21212  PyObject *__pyx_t_5 = NULL;
21213  PyObject *__pyx_t_6 = NULL;
21214  int __pyx_t_7;
21215  int __pyx_t_8;
21216  int __pyx_t_9;
21217  int __pyx_t_10;
21218  int __pyx_lineno = 0;
21219  const char *__pyx_filename = NULL;
21220  int __pyx_clineno = 0;
21221  __Pyx_RefNannySetupContext("format_from_typeinfo", 0);
21222 
21223  /* "BufferFormatFromTypeInfo":1468
21224  * cdef bytes part, result
21225  *
21226  * if type.typegroup == 'S': # <<<<<<<<<<<<<<
21227  * assert type.fields != NULL and type.fields.type != NULL
21228  *
21229  */
21230  __pyx_t_1 = ((__pyx_v_type->typegroup == 'S') != 0);
21231  if (__pyx_t_1) {
21232 
21233  /* "BufferFormatFromTypeInfo":1469
21234  *
21235  * if type.typegroup == 'S':
21236  * assert type.fields != NULL and type.fields.type != NULL # <<<<<<<<<<<<<<
21237  *
21238  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
21239  */
21240  #ifndef CYTHON_WITHOUT_ASSERTIONS
21241  if (unlikely(!Py_OptimizeFlag)) {
21242  __pyx_t_2 = ((__pyx_v_type->fields != NULL) != 0);
21243  if (__pyx_t_2) {
21244  } else {
21245  __pyx_t_1 = __pyx_t_2;
21246  goto __pyx_L4_bool_binop_done;
21247  }
21248  __pyx_t_2 = ((__pyx_v_type->fields->type != NULL) != 0);
21249  __pyx_t_1 = __pyx_t_2;
21250  __pyx_L4_bool_binop_done:;
21251  if (unlikely(!__pyx_t_1)) {
21252  PyErr_SetNone(PyExc_AssertionError);
21253  __PYX_ERR(2, 1469, __pyx_L1_error)
21254  }
21255  }
21256  #endif
21257 
21258  /* "BufferFormatFromTypeInfo":1471
21259  * assert type.fields != NULL and type.fields.type != NULL
21260  *
21261  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
21262  * alignment = b'^'
21263  * else:
21264  */
21265  __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
21266  if (__pyx_t_1) {
21267 
21268  /* "BufferFormatFromTypeInfo":1472
21269  *
21270  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
21271  * alignment = b'^' # <<<<<<<<<<<<<<
21272  * else:
21273  * alignment = b''
21274  */
21275  __Pyx_INCREF(__pyx_kp_b__24);
21276  __pyx_v_alignment = __pyx_kp_b__24;
21277 
21278  /* "BufferFormatFromTypeInfo":1471
21279  * assert type.fields != NULL and type.fields.type != NULL
21280  *
21281  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
21282  * alignment = b'^'
21283  * else:
21284  */
21285  goto __pyx_L6;
21286  }
21287 
21288  /* "BufferFormatFromTypeInfo":1474
21289  * alignment = b'^'
21290  * else:
21291  * alignment = b'' # <<<<<<<<<<<<<<
21292  *
21293  * parts = [b"T{"]
21294  */
21295  /*else*/ {
21296  __Pyx_INCREF(__pyx_kp_b__25);
21297  __pyx_v_alignment = __pyx_kp_b__25;
21298  }
21299  __pyx_L6:;
21300 
21301  /* "BufferFormatFromTypeInfo":1476
21302  * alignment = b''
21303  *
21304  * parts = [b"T{"] # <<<<<<<<<<<<<<
21305  * field = type.fields
21306  *
21307  */
21308  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1476, __pyx_L1_error)
21309  __Pyx_GOTREF(__pyx_t_3);
21310  __Pyx_INCREF(__pyx_kp_b_T);
21311  __Pyx_GIVEREF(__pyx_kp_b_T);
21312  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_b_T);
21313  __pyx_v_parts = ((PyObject*)__pyx_t_3);
21314  __pyx_t_3 = 0;
21315 
21316  /* "BufferFormatFromTypeInfo":1477
21317  *
21318  * parts = [b"T{"]
21319  * field = type.fields # <<<<<<<<<<<<<<
21320  *
21321  * while field.type:
21322  */
21323  __pyx_t_4 = __pyx_v_type->fields;
21324  __pyx_v_field = __pyx_t_4;
21325 
21326  /* "BufferFormatFromTypeInfo":1479
21327  * field = type.fields
21328  *
21329  * while field.type: # <<<<<<<<<<<<<<
21330  * part = format_from_typeinfo(field.type)
21331  * parts.append(part + b':' + field.name + b':')
21332  */
21333  while (1) {
21334  __pyx_t_1 = (__pyx_v_field->type != 0);
21335  if (!__pyx_t_1) break;
21336 
21337  /* "BufferFormatFromTypeInfo":1480
21338  *
21339  * while field.type:
21340  * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<<
21341  * parts.append(part + b':' + field.name + b':')
21342  * field += 1
21343  */
21344  __pyx_t_3 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1480, __pyx_L1_error)
21345  __Pyx_GOTREF(__pyx_t_3);
21346  __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_3));
21347  __pyx_t_3 = 0;
21348 
21349  /* "BufferFormatFromTypeInfo":1481
21350  * while field.type:
21351  * part = format_from_typeinfo(field.type)
21352  * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<<
21353  * field += 1
21354  *
21355  */
21356  __pyx_t_3 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__26); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1481, __pyx_L1_error)
21357  __Pyx_GOTREF(__pyx_t_3);
21358  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1481, __pyx_L1_error)
21359  __Pyx_GOTREF(__pyx_t_5);
21360  __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1481, __pyx_L1_error)
21361  __Pyx_GOTREF(__pyx_t_6);
21362  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21363  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21364  __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__26); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1481, __pyx_L1_error)
21365  __Pyx_GOTREF(__pyx_t_5);
21366  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21367  __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 1481, __pyx_L1_error)
21368  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21369 
21370  /* "BufferFormatFromTypeInfo":1482
21371  * part = format_from_typeinfo(field.type)
21372  * parts.append(part + b':' + field.name + b':')
21373  * field += 1 # <<<<<<<<<<<<<<
21374  *
21375  * result = alignment.join(parts) + b'}'
21376  */
21377  __pyx_v_field = (__pyx_v_field + 1);
21378  }
21379 
21380  /* "BufferFormatFromTypeInfo":1484
21381  * field += 1
21382  *
21383  * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<<
21384  * else:
21385  * fmt = __Pyx_TypeInfoToFormat(type)
21386  */
21387  __pyx_t_5 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1484, __pyx_L1_error)
21388  __Pyx_GOTREF(__pyx_t_5);
21389  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__27); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1484, __pyx_L1_error)
21390  __Pyx_GOTREF(__pyx_t_6);
21391  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21392  if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(2, 1484, __pyx_L1_error)
21393  __pyx_v_result = ((PyObject*)__pyx_t_6);
21394  __pyx_t_6 = 0;
21395 
21396  /* "BufferFormatFromTypeInfo":1468
21397  * cdef bytes part, result
21398  *
21399  * if type.typegroup == 'S': # <<<<<<<<<<<<<<
21400  * assert type.fields != NULL and type.fields.type != NULL
21401  *
21402  */
21403  goto __pyx_L3;
21404  }
21405 
21406  /* "BufferFormatFromTypeInfo":1486
21407  * result = alignment.join(parts) + b'}'
21408  * else:
21409  * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<<
21410  * if type.arraysize[0]:
21411  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
21412  */
21413  /*else*/ {
21414  __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
21415 
21416  /* "BufferFormatFromTypeInfo":1487
21417  * else:
21418  * fmt = __Pyx_TypeInfoToFormat(type)
21419  * if type.arraysize[0]: # <<<<<<<<<<<<<<
21420  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
21421  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
21422  */
21423  __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
21424  if (__pyx_t_1) {
21425 
21426  /* "BufferFormatFromTypeInfo":1488
21427  * fmt = __Pyx_TypeInfoToFormat(type)
21428  * if type.arraysize[0]:
21429  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] # <<<<<<<<<<<<<<
21430  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
21431  * else:
21432  */
21433  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1488, __pyx_L1_error)
21434  __Pyx_GOTREF(__pyx_t_6);
21435  __pyx_t_8 = __pyx_v_type->ndim;
21436  __pyx_t_9 = __pyx_t_8;
21437  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
21438  __pyx_v_i = __pyx_t_10;
21439  __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1488, __pyx_L1_error)
21440  __Pyx_GOTREF(__pyx_t_5);
21441  __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1488, __pyx_L1_error)
21442  __Pyx_GOTREF(__pyx_t_3);
21443  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21444  if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) __PYX_ERR(2, 1488, __pyx_L1_error)
21445  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21446  }
21447  __pyx_v_extents = ((PyObject*)__pyx_t_6);
21448  __pyx_t_6 = 0;
21449 
21450  /* "BufferFormatFromTypeInfo":1489
21451  * if type.arraysize[0]:
21452  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
21453  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string # <<<<<<<<<<<<<<
21454  * else:
21455  * result = fmt.string
21456  */
21457  __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__28, __pyx_v_extents); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1489, __pyx_L1_error)
21458  __Pyx_GOTREF(__pyx_t_6);
21459  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1489, __pyx_L1_error)
21460  __Pyx_GOTREF(__pyx_t_3);
21461  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21462  __pyx_t_6 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1489, __pyx_L1_error)
21463  __Pyx_GOTREF(__pyx_t_6);
21464  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21465  __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1489, __pyx_L1_error)
21466  __Pyx_GOTREF(__pyx_t_3);
21467  __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1489, __pyx_L1_error)
21468  __Pyx_GOTREF(__pyx_t_5);
21469  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21470  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21471  if (!(likely(PyBytes_CheckExact(__pyx_t_5))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(2, 1489, __pyx_L1_error)
21472  __pyx_v_result = ((PyObject*)__pyx_t_5);
21473  __pyx_t_5 = 0;
21474 
21475  /* "BufferFormatFromTypeInfo":1487
21476  * else:
21477  * fmt = __Pyx_TypeInfoToFormat(type)
21478  * if type.arraysize[0]: # <<<<<<<<<<<<<<
21479  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
21480  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
21481  */
21482  goto __pyx_L9;
21483  }
21484 
21485  /* "BufferFormatFromTypeInfo":1491
21486  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
21487  * else:
21488  * result = fmt.string # <<<<<<<<<<<<<<
21489  *
21490  * return result
21491  */
21492  /*else*/ {
21493  __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1491, __pyx_L1_error)
21494  __Pyx_GOTREF(__pyx_t_5);
21495  __pyx_v_result = ((PyObject*)__pyx_t_5);
21496  __pyx_t_5 = 0;
21497  }
21498  __pyx_L9:;
21499  }
21500  __pyx_L3:;
21501 
21502  /* "BufferFormatFromTypeInfo":1493
21503  * result = fmt.string
21504  *
21505  * return result # <<<<<<<<<<<<<<
21506  */
21507  __Pyx_XDECREF(__pyx_r);
21508  __Pyx_INCREF(__pyx_v_result);
21509  __pyx_r = __pyx_v_result;
21510  goto __pyx_L0;
21511 
21512  /* "BufferFormatFromTypeInfo":1463
21513  *
21514  * @cname('__pyx_format_from_typeinfo')
21515  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
21516  * cdef __Pyx_StructField *field
21517  * cdef __pyx_typeinfo_string fmt
21518  */
21519 
21520  /* function exit code */
21521  __pyx_L1_error:;
21522  __Pyx_XDECREF(__pyx_t_3);
21523  __Pyx_XDECREF(__pyx_t_5);
21524  __Pyx_XDECREF(__pyx_t_6);
21525  __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
21526  __pyx_r = 0;
21527  __pyx_L0:;
21528  __Pyx_XDECREF(__pyx_v_part);
21529  __Pyx_XDECREF(__pyx_v_result);
21530  __Pyx_XDECREF(__pyx_v_alignment);
21531  __Pyx_XDECREF(__pyx_v_parts);
21532  __Pyx_XDECREF(__pyx_v_extents);
21533  __Pyx_XGIVEREF(__pyx_r);
21534  __Pyx_RefNannyFinishContext();
21535  return __pyx_r;
21536 }
21537 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21538 
21539 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21540  struct __pyx_array_obj *p;
21541  PyObject *o;
21542  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21543  o = (*t->tp_alloc)(t, 0);
21544  } else {
21545  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21546  }
21547  if (unlikely(!o)) return 0;
21548  p = ((struct __pyx_array_obj *)o);
21549  p->__pyx_vtab = __pyx_vtabptr_array;
21550  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21551  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21552  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
21553  return o;
21554  bad:
21555  Py_DECREF(o); o = 0;
21556  return NULL;
21557 }
21558 
21559 static void __pyx_tp_dealloc_array(PyObject *o) {
21560  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
21561  #if CYTHON_USE_TP_FINALIZE
21562  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21563  if (PyObject_CallFinalizerFromDealloc(o)) return;
21564  }
21565  #endif
21566  {
21567  PyObject *etype, *eval, *etb;
21568  PyErr_Fetch(&etype, &eval, &etb);
21569  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21570  __pyx_array___dealloc__(o);
21571  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21572  PyErr_Restore(etype, eval, etb);
21573  }
21574  Py_CLEAR(p->mode);
21575  Py_CLEAR(p->_format);
21576  (*Py_TYPE(o)->tp_free)(o);
21577 }
21578 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21579  PyObject *r;
21580  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21581  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21582  Py_DECREF(x);
21583  return r;
21584 }
21585 
21586 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21587  if (v) {
21588  return __pyx_array___setitem__(o, i, v);
21589  }
21590  else {
21591  PyErr_Format(PyExc_NotImplementedError,
21592  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21593  return -1;
21594  }
21595 }
21596 
21597 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21598  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21599  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21600  PyErr_Clear();
21601  v = __pyx_array___getattr__(o, n);
21602  }
21603  return v;
21604 }
21605 
21606 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
21607  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21608 }
21609 
21610 static PyMethodDef __pyx_methods_array[] = {
21611  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21612  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21613  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21614  {0, 0, 0, 0}
21615 };
21616 
21617 static struct PyGetSetDef __pyx_getsets_array[] = {
21618  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
21619  {0, 0, 0, 0, 0}
21620 };
21621 
21622 static PySequenceMethods __pyx_tp_as_sequence_array = {
21623  __pyx_array___len__, /*sq_length*/
21624  0, /*sq_concat*/
21625  0, /*sq_repeat*/
21626  __pyx_sq_item_array, /*sq_item*/
21627  0, /*sq_slice*/
21628  0, /*sq_ass_item*/
21629  0, /*sq_ass_slice*/
21630  0, /*sq_contains*/
21631  0, /*sq_inplace_concat*/
21632  0, /*sq_inplace_repeat*/
21633 };
21634 
21635 static PyMappingMethods __pyx_tp_as_mapping_array = {
21636  __pyx_array___len__, /*mp_length*/
21637  __pyx_array___getitem__, /*mp_subscript*/
21638  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
21639 };
21640 
21641 static PyBufferProcs __pyx_tp_as_buffer_array = {
21642  #if PY_MAJOR_VERSION < 3
21643  0, /*bf_getreadbuffer*/
21644  #endif
21645  #if PY_MAJOR_VERSION < 3
21646  0, /*bf_getwritebuffer*/
21647  #endif
21648  #if PY_MAJOR_VERSION < 3
21649  0, /*bf_getsegcount*/
21650  #endif
21651  #if PY_MAJOR_VERSION < 3
21652  0, /*bf_getcharbuffer*/
21653  #endif
21654  __pyx_array_getbuffer, /*bf_getbuffer*/
21655  0, /*bf_releasebuffer*/
21656 };
21657 
21658 static PyTypeObject __pyx_type___pyx_array = {
21659  PyVarObject_HEAD_INIT(0, 0)
21660  "cpartitioning.array", /*tp_name*/
21661  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
21662  0, /*tp_itemsize*/
21663  __pyx_tp_dealloc_array, /*tp_dealloc*/
21664  #if PY_VERSION_HEX < 0x030800b4
21665  0, /*tp_print*/
21666  #endif
21667  #if PY_VERSION_HEX >= 0x030800b4
21668  0, /*tp_vectorcall_offset*/
21669  #endif
21670  0, /*tp_getattr*/
21671  0, /*tp_setattr*/
21672  #if PY_MAJOR_VERSION < 3
21673  0, /*tp_compare*/
21674  #endif
21675  #if PY_MAJOR_VERSION >= 3
21676  0, /*tp_as_async*/
21677  #endif
21678  0, /*tp_repr*/
21679  0, /*tp_as_number*/
21680  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
21681  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
21682  0, /*tp_hash*/
21683  0, /*tp_call*/
21684  0, /*tp_str*/
21685  __pyx_tp_getattro_array, /*tp_getattro*/
21686  0, /*tp_setattro*/
21687  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
21688  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21689  0, /*tp_doc*/
21690  0, /*tp_traverse*/
21691  0, /*tp_clear*/
21692  0, /*tp_richcompare*/
21693  0, /*tp_weaklistoffset*/
21694  0, /*tp_iter*/
21695  0, /*tp_iternext*/
21696  __pyx_methods_array, /*tp_methods*/
21697  0, /*tp_members*/
21698  __pyx_getsets_array, /*tp_getset*/
21699  0, /*tp_base*/
21700  0, /*tp_dict*/
21701  0, /*tp_descr_get*/
21702  0, /*tp_descr_set*/
21703  0, /*tp_dictoffset*/
21704  0, /*tp_init*/
21705  0, /*tp_alloc*/
21706  __pyx_tp_new_array, /*tp_new*/
21707  0, /*tp_free*/
21708  0, /*tp_is_gc*/
21709  0, /*tp_bases*/
21710  0, /*tp_mro*/
21711  0, /*tp_cache*/
21712  0, /*tp_subclasses*/
21713  0, /*tp_weaklist*/
21714  0, /*tp_del*/
21715  0, /*tp_version_tag*/
21716  #if PY_VERSION_HEX >= 0x030400a1
21717  0, /*tp_finalize*/
21718  #endif
21719  #if PY_VERSION_HEX >= 0x030800b1
21720  0, /*tp_vectorcall*/
21721  #endif
21722  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21723  0, /*tp_print*/
21724  #endif
21725 };
21726 
21727 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21728  struct __pyx_MemviewEnum_obj *p;
21729  PyObject *o;
21730  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21731  o = (*t->tp_alloc)(t, 0);
21732  } else {
21733  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21734  }
21735  if (unlikely(!o)) return 0;
21736  p = ((struct __pyx_MemviewEnum_obj *)o);
21737  p->name = Py_None; Py_INCREF(Py_None);
21738  return o;
21739 }
21740 
21741 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21742  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21743  #if CYTHON_USE_TP_FINALIZE
21744  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21745  if (PyObject_CallFinalizerFromDealloc(o)) return;
21746  }
21747  #endif
21748  PyObject_GC_UnTrack(o);
21749  Py_CLEAR(p->name);
21750  (*Py_TYPE(o)->tp_free)(o);
21751 }
21752 
21753 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
21754  int e;
21755  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21756  if (p->name) {
21757  e = (*v)(p->name, a); if (e) return e;
21758  }
21759  return 0;
21760 }
21761 
21762 static int __pyx_tp_clear_Enum(PyObject *o) {
21763  PyObject* tmp;
21764  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21765  tmp = ((PyObject*)p->name);
21766  p->name = Py_None; Py_INCREF(Py_None);
21767  Py_XDECREF(tmp);
21768  return 0;
21769 }
21770 
21771 static PyMethodDef __pyx_methods_Enum[] = {
21772  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21773  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21774  {0, 0, 0, 0}
21775 };
21776 
21777 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21778  PyVarObject_HEAD_INIT(0, 0)
21779  "cpartitioning.Enum", /*tp_name*/
21780  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
21781  0, /*tp_itemsize*/
21782  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
21783  #if PY_VERSION_HEX < 0x030800b4
21784  0, /*tp_print*/
21785  #endif
21786  #if PY_VERSION_HEX >= 0x030800b4
21787  0, /*tp_vectorcall_offset*/
21788  #endif
21789  0, /*tp_getattr*/
21790  0, /*tp_setattr*/
21791  #if PY_MAJOR_VERSION < 3
21792  0, /*tp_compare*/
21793  #endif
21794  #if PY_MAJOR_VERSION >= 3
21795  0, /*tp_as_async*/
21796  #endif
21797  __pyx_MemviewEnum___repr__, /*tp_repr*/
21798  0, /*tp_as_number*/
21799  0, /*tp_as_sequence*/
21800  0, /*tp_as_mapping*/
21801  0, /*tp_hash*/
21802  0, /*tp_call*/
21803  0, /*tp_str*/
21804  0, /*tp_getattro*/
21805  0, /*tp_setattro*/
21806  0, /*tp_as_buffer*/
21807  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21808  0, /*tp_doc*/
21809  __pyx_tp_traverse_Enum, /*tp_traverse*/
21810  __pyx_tp_clear_Enum, /*tp_clear*/
21811  0, /*tp_richcompare*/
21812  0, /*tp_weaklistoffset*/
21813  0, /*tp_iter*/
21814  0, /*tp_iternext*/
21815  __pyx_methods_Enum, /*tp_methods*/
21816  0, /*tp_members*/
21817  0, /*tp_getset*/
21818  0, /*tp_base*/
21819  0, /*tp_dict*/
21820  0, /*tp_descr_get*/
21821  0, /*tp_descr_set*/
21822  0, /*tp_dictoffset*/
21823  __pyx_MemviewEnum___init__, /*tp_init*/
21824  0, /*tp_alloc*/
21825  __pyx_tp_new_Enum, /*tp_new*/
21826  0, /*tp_free*/
21827  0, /*tp_is_gc*/
21828  0, /*tp_bases*/
21829  0, /*tp_mro*/
21830  0, /*tp_cache*/
21831  0, /*tp_subclasses*/
21832  0, /*tp_weaklist*/
21833  0, /*tp_del*/
21834  0, /*tp_version_tag*/
21835  #if PY_VERSION_HEX >= 0x030400a1
21836  0, /*tp_finalize*/
21837  #endif
21838  #if PY_VERSION_HEX >= 0x030800b1
21839  0, /*tp_vectorcall*/
21840  #endif
21841  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21842  0, /*tp_print*/
21843  #endif
21844 };
21845 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21846 
21847 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21848  struct __pyx_memoryview_obj *p;
21849  PyObject *o;
21850  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21851  o = (*t->tp_alloc)(t, 0);
21852  } else {
21853  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21854  }
21855  if (unlikely(!o)) return 0;
21856  p = ((struct __pyx_memoryview_obj *)o);
21857  p->__pyx_vtab = __pyx_vtabptr_memoryview;
21858  p->obj = Py_None; Py_INCREF(Py_None);
21859  p->_size = Py_None; Py_INCREF(Py_None);
21860  p->_array_interface = Py_None; Py_INCREF(Py_None);
21861  p->view.obj = NULL;
21862  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
21863  return o;
21864  bad:
21865  Py_DECREF(o); o = 0;
21866  return NULL;
21867 }
21868 
21869 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21870  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21871  #if CYTHON_USE_TP_FINALIZE
21872  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21873  if (PyObject_CallFinalizerFromDealloc(o)) return;
21874  }
21875  #endif
21876  PyObject_GC_UnTrack(o);
21877  {
21878  PyObject *etype, *eval, *etb;
21879  PyErr_Fetch(&etype, &eval, &etb);
21880  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21881  __pyx_memoryview___dealloc__(o);
21882  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21883  PyErr_Restore(etype, eval, etb);
21884  }
21885  Py_CLEAR(p->obj);
21886  Py_CLEAR(p->_size);
21887  Py_CLEAR(p->_array_interface);
21888  (*Py_TYPE(o)->tp_free)(o);
21889 }
21890 
21891 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
21892  int e;
21893  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21894  if (p->obj) {
21895  e = (*v)(p->obj, a); if (e) return e;
21896  }
21897  if (p->_size) {
21898  e = (*v)(p->_size, a); if (e) return e;
21899  }
21900  if (p->_array_interface) {
21901  e = (*v)(p->_array_interface, a); if (e) return e;
21902  }
21903  if (p->view.obj) {
21904  e = (*v)(p->view.obj, a); if (e) return e;
21905  }
21906  return 0;
21907 }
21908 
21909 static int __pyx_tp_clear_memoryview(PyObject *o) {
21910  PyObject* tmp;
21911  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21912  tmp = ((PyObject*)p->obj);
21913  p->obj = Py_None; Py_INCREF(Py_None);
21914  Py_XDECREF(tmp);
21915  tmp = ((PyObject*)p->_size);
21916  p->_size = Py_None; Py_INCREF(Py_None);
21917  Py_XDECREF(tmp);
21918  tmp = ((PyObject*)p->_array_interface);
21919  p->_array_interface = Py_None; Py_INCREF(Py_None);
21920  Py_XDECREF(tmp);
21921  Py_CLEAR(p->view.obj);
21922  return 0;
21923 }
21924 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
21925  PyObject *r;
21926  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21927  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21928  Py_DECREF(x);
21929  return r;
21930 }
21931 
21932 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
21933  if (v) {
21934  return __pyx_memoryview___setitem__(o, i, v);
21935  }
21936  else {
21937  PyErr_Format(PyExc_NotImplementedError,
21938  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21939  return -1;
21940  }
21941 }
21942 
21943 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
21944  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21945 }
21946 
21947 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
21948  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21949 }
21950 
21951 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
21952  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21953 }
21954 
21955 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
21956  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21957 }
21958 
21959 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
21960  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21961 }
21962 
21963 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
21964  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21965 }
21966 
21967 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
21968  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21969 }
21970 
21971 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
21972  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21973 }
21974 
21975 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
21976  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21977 }
21978 
21979 static PyMethodDef __pyx_methods_memoryview[] = {
21980  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21981  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21982  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21983  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21984  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21985  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21986  {0, 0, 0, 0}
21987 };
21988 
21989 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21990  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
21991  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
21992  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
21993  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
21994  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
21995  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
21996  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
21997  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
21998  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
21999  {0, 0, 0, 0, 0}
22000 };
22001 
22002 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22003  __pyx_memoryview___len__, /*sq_length*/
22004  0, /*sq_concat*/
22005  0, /*sq_repeat*/
22006  __pyx_sq_item_memoryview, /*sq_item*/
22007  0, /*sq_slice*/
22008  0, /*sq_ass_item*/
22009  0, /*sq_ass_slice*/
22010  0, /*sq_contains*/
22011  0, /*sq_inplace_concat*/
22012  0, /*sq_inplace_repeat*/
22013 };
22014 
22015 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22016  __pyx_memoryview___len__, /*mp_length*/
22017  __pyx_memoryview___getitem__, /*mp_subscript*/
22018  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
22019 };
22020 
22021 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22022  #if PY_MAJOR_VERSION < 3
22023  0, /*bf_getreadbuffer*/
22024  #endif
22025  #if PY_MAJOR_VERSION < 3
22026  0, /*bf_getwritebuffer*/
22027  #endif
22028  #if PY_MAJOR_VERSION < 3
22029  0, /*bf_getsegcount*/
22030  #endif
22031  #if PY_MAJOR_VERSION < 3
22032  0, /*bf_getcharbuffer*/
22033  #endif
22034  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
22035  0, /*bf_releasebuffer*/
22036 };
22037 
22038 static PyTypeObject __pyx_type___pyx_memoryview = {
22039  PyVarObject_HEAD_INIT(0, 0)
22040  "cpartitioning.memoryview", /*tp_name*/
22041  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
22042  0, /*tp_itemsize*/
22043  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
22044  #if PY_VERSION_HEX < 0x030800b4
22045  0, /*tp_print*/
22046  #endif
22047  #if PY_VERSION_HEX >= 0x030800b4
22048  0, /*tp_vectorcall_offset*/
22049  #endif
22050  0, /*tp_getattr*/
22051  0, /*tp_setattr*/
22052  #if PY_MAJOR_VERSION < 3
22053  0, /*tp_compare*/
22054  #endif
22055  #if PY_MAJOR_VERSION >= 3
22056  0, /*tp_as_async*/
22057  #endif
22058  __pyx_memoryview___repr__, /*tp_repr*/
22059  0, /*tp_as_number*/
22060  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
22061  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
22062  0, /*tp_hash*/
22063  0, /*tp_call*/
22064  __pyx_memoryview___str__, /*tp_str*/
22065  0, /*tp_getattro*/
22066  0, /*tp_setattro*/
22067  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
22068  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22069  0, /*tp_doc*/
22070  __pyx_tp_traverse_memoryview, /*tp_traverse*/
22071  __pyx_tp_clear_memoryview, /*tp_clear*/
22072  0, /*tp_richcompare*/
22073  0, /*tp_weaklistoffset*/
22074  0, /*tp_iter*/
22075  0, /*tp_iternext*/
22076  __pyx_methods_memoryview, /*tp_methods*/
22077  0, /*tp_members*/
22078  __pyx_getsets_memoryview, /*tp_getset*/
22079  0, /*tp_base*/
22080  0, /*tp_dict*/
22081  0, /*tp_descr_get*/
22082  0, /*tp_descr_set*/
22083  0, /*tp_dictoffset*/
22084  0, /*tp_init*/
22085  0, /*tp_alloc*/
22086  __pyx_tp_new_memoryview, /*tp_new*/
22087  0, /*tp_free*/
22088  0, /*tp_is_gc*/
22089  0, /*tp_bases*/
22090  0, /*tp_mro*/
22091  0, /*tp_cache*/
22092  0, /*tp_subclasses*/
22093  0, /*tp_weaklist*/
22094  0, /*tp_del*/
22095  0, /*tp_version_tag*/
22096  #if PY_VERSION_HEX >= 0x030400a1
22097  0, /*tp_finalize*/
22098  #endif
22099  #if PY_VERSION_HEX >= 0x030800b1
22100  0, /*tp_vectorcall*/
22101  #endif
22102  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22103  0, /*tp_print*/
22104  #endif
22105 };
22106 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22107 
22108 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22109  struct __pyx_memoryviewslice_obj *p;
22110  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22111  if (unlikely(!o)) return 0;
22112  p = ((struct __pyx_memoryviewslice_obj *)o);
22113  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22114  p->from_object = Py_None; Py_INCREF(Py_None);
22115  p->from_slice.memview = NULL;
22116  return o;
22117 }
22118 
22119 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22120  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22121  #if CYTHON_USE_TP_FINALIZE
22122  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22123  if (PyObject_CallFinalizerFromDealloc(o)) return;
22124  }
22125  #endif
22126  PyObject_GC_UnTrack(o);
22127  {
22128  PyObject *etype, *eval, *etb;
22129  PyErr_Fetch(&etype, &eval, &etb);
22130  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22131  __pyx_memoryviewslice___dealloc__(o);
22132  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22133  PyErr_Restore(etype, eval, etb);
22134  }
22135  Py_CLEAR(p->from_object);
22136  PyObject_GC_Track(o);
22137  __pyx_tp_dealloc_memoryview(o);
22138 }
22139 
22140 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
22141  int e;
22142  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22143  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
22144  if (p->from_object) {
22145  e = (*v)(p->from_object, a); if (e) return e;
22146  }
22147  return 0;
22148 }
22149 
22150 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22151  PyObject* tmp;
22152  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22153  __pyx_tp_clear_memoryview(o);
22154  tmp = ((PyObject*)p->from_object);
22155  p->from_object = Py_None; Py_INCREF(Py_None);
22156  Py_XDECREF(tmp);
22157  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22158  return 0;
22159 }
22160 
22161 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
22162  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22163 }
22164 
22165 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22166  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22167  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22168  {0, 0, 0, 0}
22169 };
22170 
22171 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22172  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
22173  {0, 0, 0, 0, 0}
22174 };
22175 
22176 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22177  PyVarObject_HEAD_INIT(0, 0)
22178  "cpartitioning._memoryviewslice", /*tp_name*/
22179  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
22180  0, /*tp_itemsize*/
22181  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
22182  #if PY_VERSION_HEX < 0x030800b4
22183  0, /*tp_print*/
22184  #endif
22185  #if PY_VERSION_HEX >= 0x030800b4
22186  0, /*tp_vectorcall_offset*/
22187  #endif
22188  0, /*tp_getattr*/
22189  0, /*tp_setattr*/
22190  #if PY_MAJOR_VERSION < 3
22191  0, /*tp_compare*/
22192  #endif
22193  #if PY_MAJOR_VERSION >= 3
22194  0, /*tp_as_async*/
22195  #endif
22196  #if CYTHON_COMPILING_IN_PYPY
22197  __pyx_memoryview___repr__, /*tp_repr*/
22198  #else
22199  0, /*tp_repr*/
22200  #endif
22201  0, /*tp_as_number*/
22202  0, /*tp_as_sequence*/
22203  0, /*tp_as_mapping*/
22204  0, /*tp_hash*/
22205  0, /*tp_call*/
22206  #if CYTHON_COMPILING_IN_PYPY
22207  __pyx_memoryview___str__, /*tp_str*/
22208  #else
22209  0, /*tp_str*/
22210  #endif
22211  0, /*tp_getattro*/
22212  0, /*tp_setattro*/
22213  0, /*tp_as_buffer*/
22214  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22215  "Internal class for passing memoryview slices to Python", /*tp_doc*/
22216  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
22217  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
22218  0, /*tp_richcompare*/
22219  0, /*tp_weaklistoffset*/
22220  0, /*tp_iter*/
22221  0, /*tp_iternext*/
22222  __pyx_methods__memoryviewslice, /*tp_methods*/
22223  0, /*tp_members*/
22224  __pyx_getsets__memoryviewslice, /*tp_getset*/
22225  0, /*tp_base*/
22226  0, /*tp_dict*/
22227  0, /*tp_descr_get*/
22228  0, /*tp_descr_set*/
22229  0, /*tp_dictoffset*/
22230  0, /*tp_init*/
22231  0, /*tp_alloc*/
22232  __pyx_tp_new__memoryviewslice, /*tp_new*/
22233  0, /*tp_free*/
22234  0, /*tp_is_gc*/
22235  0, /*tp_bases*/
22236  0, /*tp_mro*/
22237  0, /*tp_cache*/
22238  0, /*tp_subclasses*/
22239  0, /*tp_weaklist*/
22240  0, /*tp_del*/
22241  0, /*tp_version_tag*/
22242  #if PY_VERSION_HEX >= 0x030400a1
22243  0, /*tp_finalize*/
22244  #endif
22245  #if PY_VERSION_HEX >= 0x030800b1
22246  0, /*tp_vectorcall*/
22247  #endif
22248  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22249  0, /*tp_print*/
22250  #endif
22251 };
22252 
22253 static PyMethodDef __pyx_methods[] = {
22254  {0, 0, 0, 0}
22255 };
22256 
22257 #if PY_MAJOR_VERSION >= 3
22258 #if CYTHON_PEP489_MULTI_PHASE_INIT
22259 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
22260 static int __pyx_pymod_exec_cpartitioning(PyObject* module); /*proto*/
22261 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22262  {Py_mod_create, (void*)__pyx_pymod_create},
22263  {Py_mod_exec, (void*)__pyx_pymod_exec_cpartitioning},
22264  {0, NULL}
22265 };
22266 #endif
22267 
22268 static struct PyModuleDef __pyx_moduledef = {
22269  PyModuleDef_HEAD_INIT,
22270  "cpartitioning",
22271  0, /* m_doc */
22272  #if CYTHON_PEP489_MULTI_PHASE_INIT
22273  0, /* m_size */
22274  #else
22275  -1, /* m_size */
22276  #endif
22277  __pyx_methods /* m_methods */,
22278  #if CYTHON_PEP489_MULTI_PHASE_INIT
22279  __pyx_moduledef_slots, /* m_slots */
22280  #else
22281  NULL, /* m_reload */
22282  #endif
22283  NULL, /* m_traverse */
22284  NULL, /* m_clear */
22285  NULL /* m_free */
22286 };
22287 #endif
22288 #ifndef CYTHON_SMALL_CODE
22289 #if defined(__clang__)
22290  #define CYTHON_SMALL_CODE
22291 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22292  #define CYTHON_SMALL_CODE __attribute__((cold))
22293 #else
22294  #define CYTHON_SMALL_CODE
22295 #endif
22296 #endif
22297 
22298 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22299  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22300  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22301  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22302  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22303  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22304  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22305  {&__pyx_n_s_Comm, __pyx_k_Comm, sizeof(__pyx_k_Comm), 0, 0, 1, 1},
22306  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22307  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22308  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
22309  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
22310  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22311  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
22312  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22313  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22314  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22315  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22316  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22317  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22318  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22319  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
22320  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
22321  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22322  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22323  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
22324  {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 0},
22325  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22326  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22327  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22328  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22329  {&__pyx_kp_b__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 0, 0},
22330  {&__pyx_kp_b__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 0, 0, 0},
22331  {&__pyx_kp_b__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 0, 0},
22332  {&__pyx_kp_b__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 0, 0, 0},
22333  {&__pyx_kp_u__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 1, 0, 0},
22334  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22335  {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
22336  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
22337  {&__pyx_n_s_buildDiscontinuousGalerkinLocal2, __pyx_k_buildDiscontinuousGalerkinLocal2, sizeof(__pyx_k_buildDiscontinuousGalerkinLocal2), 0, 0, 1, 1},
22338  {&__pyx_n_s_buildQuadraticCubeLocal2GlobalMa, __pyx_k_buildQuadraticCubeLocal2GlobalMa, sizeof(__pyx_k_buildQuadraticCubeLocal2GlobalMa), 0, 0, 1, 1},
22339  {&__pyx_kp_s_buildQuadraticCubeSubdomain2Glob, __pyx_k_buildQuadraticCubeSubdomain2Glob, sizeof(__pyx_k_buildQuadraticCubeSubdomain2Glob), 0, 0, 1, 0},
22340  {&__pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2, __pyx_k_buildQuadraticCubeSubdomain2Glob_2, sizeof(__pyx_k_buildQuadraticCubeSubdomain2Glob_2), 0, 0, 1, 0},
22341  {&__pyx_n_s_buildQuadraticLocal2GlobalMappin, __pyx_k_buildQuadraticLocal2GlobalMappin, sizeof(__pyx_k_buildQuadraticLocal2GlobalMappin), 0, 0, 1, 1},
22342  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
22343  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
22344  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
22345  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22346  {&__pyx_n_s_cmesh, __pyx_k_cmesh, sizeof(__pyx_k_cmesh), 0, 0, 1, 1},
22347  {&__pyx_n_s_comm, __pyx_k_comm, sizeof(__pyx_k_comm), 0, 0, 1, 1},
22348  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22349  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22350  {&__pyx_n_s_convertPUMIPartitionToPython, __pyx_k_convertPUMIPartitionToPython, sizeof(__pyx_k_convertPUMIPartitionToPython), 0, 0, 1, 1},
22351  {&__pyx_n_s_cpartitioning, __pyx_k_cpartitioning, sizeof(__pyx_k_cpartitioning), 0, 0, 1, 1},
22352  {&__pyx_n_s_dgNumbering_subdomain2global, __pyx_k_dgNumbering_subdomain2global, sizeof(__pyx_k_dgNumbering_subdomain2global), 0, 0, 1, 1},
22353  {&__pyx_n_s_dg_dof_offsets_subdomain_owned, __pyx_k_dg_dof_offsets_subdomain_owned, sizeof(__pyx_k_dg_dof_offsets_subdomain_owned), 0, 0, 1, 1},
22354  {&__pyx_n_s_dg_subdomain_l2g, __pyx_k_dg_subdomain_l2g, sizeof(__pyx_k_dg_subdomain_l2g), 0, 0, 1, 1},
22355  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
22356  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22357  {&__pyx_n_s_edgeNumbering_subdomain2global, __pyx_k_edgeNumbering_subdomain2global, sizeof(__pyx_k_edgeNumbering_subdomain2global), 0, 0, 1, 1},
22358  {&__pyx_n_s_edgeOffsets_subdomain_owned, __pyx_k_edgeOffsets_subdomain_owned, sizeof(__pyx_k_edgeOffsets_subdomain_owned), 0, 0, 1, 1},
22359  {&__pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_k_elementBoundaryNumbering_subdoma, sizeof(__pyx_k_elementBoundaryNumbering_subdoma), 0, 0, 1, 1},
22360  {&__pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_k_elementBoundaryOffsets_subdomain, sizeof(__pyx_k_elementBoundaryOffsets_subdomain), 0, 0, 1, 1},
22361  {&__pyx_n_s_elementNumbering_subdomain2globa, __pyx_k_elementNumbering_subdomain2globa, sizeof(__pyx_k_elementNumbering_subdomain2globa), 0, 0, 1, 1},
22362  {&__pyx_n_s_elementOffsets_subdomain_owned, __pyx_k_elementOffsets_subdomain_owned, sizeof(__pyx_k_elementOffsets_subdomain_owned), 0, 0, 1, 1},
22363  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
22364  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22365  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
22366  {&__pyx_n_s_filebase, __pyx_k_filebase, sizeof(__pyx_k_filebase), 0, 0, 1, 1},
22367  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
22368  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
22369  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22370  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22371  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22372  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22373  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
22374  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
22375  {&__pyx_n_s_indexBase, __pyx_k_indexBase, sizeof(__pyx_k_indexBase), 0, 0, 1, 1},
22376  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22377  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22378  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
22379  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
22380  {&__pyx_n_s_max_dof_neighbors, __pyx_k_max_dof_neighbors, sizeof(__pyx_k_max_dof_neighbors), 0, 0, 1, 1},
22381  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
22382  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
22383  {&__pyx_n_s_nDOF_all_processes, __pyx_k_nDOF_all_processes, sizeof(__pyx_k_nDOF_all_processes), 0, 0, 1, 1},
22384  {&__pyx_n_s_nDOF_element, __pyx_k_nDOF_element, sizeof(__pyx_k_nDOF_element), 0, 0, 1, 1},
22385  {&__pyx_n_s_nDOF_subdomain, __pyx_k_nDOF_subdomain, sizeof(__pyx_k_nDOF_subdomain), 0, 0, 1, 1},
22386  {&__pyx_n_s_nLayersOfOverlap, __pyx_k_nLayersOfOverlap, sizeof(__pyx_k_nLayersOfOverlap), 0, 0, 1, 1},
22387  {&__pyx_n_s_nSpace, __pyx_k_nSpace, sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
22388  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
22389  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22390  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22391  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
22392  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22393  {&__pyx_n_s_nodeNumbering_subdomain2global, __pyx_k_nodeNumbering_subdomain2global, sizeof(__pyx_k_nodeNumbering_subdomain2global), 0, 0, 1, 1},
22394  {&__pyx_n_s_nodeOffsets_subdomain_owned, __pyx_k_nodeOffsets_subdomain_owned, sizeof(__pyx_k_nodeOffsets_subdomain_owned), 0, 0, 1, 1},
22395  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
22396  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22397  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22398  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22399  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
22400  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
22401  {&__pyx_n_s_partitionElements, __pyx_k_partitionElements, sizeof(__pyx_k_partitionElements), 0, 0, 1, 1},
22402  {&__pyx_n_s_partitionNodes, __pyx_k_partitionNodes, sizeof(__pyx_k_partitionNodes), 0, 0, 1, 1},
22403  {&__pyx_n_s_partitionNodesFromTetgenFiles, __pyx_k_partitionNodesFromTetgenFiles, sizeof(__pyx_k_partitionNodesFromTetgenFiles), 0, 0, 1, 1},
22404  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22405  {&__pyx_n_s_proteus, __pyx_k_proteus, sizeof(__pyx_k_proteus), 0, 0, 1, 1},
22406  {&__pyx_n_s_proteus_Comm, __pyx_k_proteus_Comm, sizeof(__pyx_k_proteus_Comm), 0, 0, 1, 1},
22407  {&__pyx_kp_s_proteus_cpartitioning_pyx, __pyx_k_proteus_cpartitioning_pyx, sizeof(__pyx_k_proteus_cpartitioning_pyx), 0, 0, 1, 0},
22408  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22409  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22410  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22411  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22412  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22413  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22414  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22415  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22416  {&__pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_k_quadraticNumbering_subdomain2glo, sizeof(__pyx_k_quadraticNumbering_subdomain2glo), 0, 0, 1, 1},
22417  {&__pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_k_quadratic_dof_offsets_subdomain, sizeof(__pyx_k_quadratic_dof_offsets_subdomain), 0, 0, 1, 1},
22418  {&__pyx_n_s_quadratic_lagrangeNodes, __pyx_k_quadratic_lagrangeNodes, sizeof(__pyx_k_quadratic_lagrangeNodes), 0, 0, 1, 1},
22419  {&__pyx_n_s_quadratic_subdomain_l2g, __pyx_k_quadratic_subdomain_l2g, sizeof(__pyx_k_quadratic_subdomain_l2g), 0, 0, 1, 1},
22420  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
22421  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22422  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22423  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22424  {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
22425  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22426  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22427  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
22428  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
22429  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
22430  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
22431  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
22432  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22433  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22434  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22435  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22436  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
22437  {&__pyx_n_s_subdomain_cmesh, __pyx_k_subdomain_cmesh, sizeof(__pyx_k_subdomain_cmesh), 0, 0, 1, 1},
22438  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
22439  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22440  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22441  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
22442  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22443  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
22444  {0, 0, 0, 0, 0, 0, 0}
22445 };
22446 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
22447  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 777, __pyx_L1_error)
22448  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 781, __pyx_L1_error)
22449  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 959, __pyx_L1_error)
22450  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 148, __pyx_L1_error)
22451  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 151, __pyx_L1_error)
22452  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(2, 180, __pyx_L1_error)
22453  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error)
22454  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 404, __pyx_L1_error)
22455  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 613, __pyx_L1_error)
22456  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 832, __pyx_L1_error)
22457  return 0;
22458  __pyx_L1_error:;
22459  return -1;
22460 }
22461 
22462 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
22463  __Pyx_RefNannyDeclarations
22464  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
22465 
22466  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":777
22467  *
22468  * if (end - f) - <int>(new_offset - offset[0]) < 15:
22469  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
22470  *
22471  * if ((child.byteorder == c'>' and little_endian) or
22472  */
22473  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 777, __pyx_L1_error)
22474  __Pyx_GOTREF(__pyx_tuple_);
22475  __Pyx_GIVEREF(__pyx_tuple_);
22476 
22477  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":781
22478  * if ((child.byteorder == c'>' and little_endian) or
22479  * (child.byteorder == c'<' and not little_endian)):
22480  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
22481  * # One could encode it in the format string and have Cython
22482  * # complain instead, BUT: < and > in format strings also imply
22483  */
22484  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 781, __pyx_L1_error)
22485  __Pyx_GOTREF(__pyx_tuple__2);
22486  __Pyx_GIVEREF(__pyx_tuple__2);
22487 
22488  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":801
22489  * t = child.type_num
22490  * if end - f < 5:
22491  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
22492  *
22493  * # Until ticket #99 is fixed, use integers to avoid warnings
22494  */
22495  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 801, __pyx_L1_error)
22496  __Pyx_GOTREF(__pyx_tuple__3);
22497  __Pyx_GIVEREF(__pyx_tuple__3);
22498 
22499  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":959
22500  * __pyx_import_array()
22501  * except Exception:
22502  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
22503  *
22504  * cdef inline int import_umath() except -1:
22505  */
22506  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 959, __pyx_L1_error)
22507  __Pyx_GOTREF(__pyx_tuple__4);
22508  __Pyx_GIVEREF(__pyx_tuple__4);
22509 
22510  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":965
22511  * _import_umath()
22512  * except Exception:
22513  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
22514  *
22515  * cdef inline int import_ufunc() except -1:
22516  */
22517  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 965, __pyx_L1_error)
22518  __Pyx_GOTREF(__pyx_tuple__5);
22519  __Pyx_GIVEREF(__pyx_tuple__5);
22520 
22521  /* "View.MemoryView":133
22522  *
22523  * if not self.ndim:
22524  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
22525  *
22526  * if itemsize <= 0:
22527  */
22528  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 133, __pyx_L1_error)
22529  __Pyx_GOTREF(__pyx_tuple__6);
22530  __Pyx_GIVEREF(__pyx_tuple__6);
22531 
22532  /* "View.MemoryView":136
22533  *
22534  * if itemsize <= 0:
22535  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
22536  *
22537  * if not isinstance(format, bytes):
22538  */
22539  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 136, __pyx_L1_error)
22540  __Pyx_GOTREF(__pyx_tuple__7);
22541  __Pyx_GIVEREF(__pyx_tuple__7);
22542 
22543  /* "View.MemoryView":148
22544  *
22545  * if not self._shape:
22546  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
22547  *
22548  *
22549  */
22550  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 148, __pyx_L1_error)
22551  __Pyx_GOTREF(__pyx_tuple__8);
22552  __Pyx_GIVEREF(__pyx_tuple__8);
22553 
22554  /* "View.MemoryView":176
22555  * self.data = <char *>malloc(self.len)
22556  * if not self.data:
22557  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
22558  *
22559  * if self.dtype_is_object:
22560  */
22561  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 176, __pyx_L1_error)
22562  __Pyx_GOTREF(__pyx_tuple__9);
22563  __Pyx_GIVEREF(__pyx_tuple__9);
22564 
22565  /* "View.MemoryView":192
22566  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
22567  * if not (flags & bufmode):
22568  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
22569  * info.buf = self.data
22570  * info.len = self.len
22571  */
22572  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 192, __pyx_L1_error)
22573  __Pyx_GOTREF(__pyx_tuple__10);
22574  __Pyx_GIVEREF(__pyx_tuple__10);
22575 
22576  /* "(tree fragment)":2
22577  * def __reduce_cython__(self):
22578  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22579  * def __setstate_cython__(self, __pyx_state):
22580  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22581  */
22582  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 2, __pyx_L1_error)
22583  __Pyx_GOTREF(__pyx_tuple__11);
22584  __Pyx_GIVEREF(__pyx_tuple__11);
22585 
22586  /* "(tree fragment)":4
22587  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22588  * def __setstate_cython__(self, __pyx_state):
22589  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22590  */
22591  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 4, __pyx_L1_error)
22592  __Pyx_GOTREF(__pyx_tuple__12);
22593  __Pyx_GIVEREF(__pyx_tuple__12);
22594 
22595  /* "View.MemoryView":418
22596  * def __setitem__(memoryview self, object index, object value):
22597  * if self.view.readonly:
22598  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
22599  *
22600  * have_slices, index = _unellipsify(index, self.view.ndim)
22601  */
22602  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 418, __pyx_L1_error)
22603  __Pyx_GOTREF(__pyx_tuple__13);
22604  __Pyx_GIVEREF(__pyx_tuple__13);
22605 
22606  /* "View.MemoryView":495
22607  * result = struct.unpack(self.view.format, bytesitem)
22608  * except struct.error:
22609  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
22610  * else:
22611  * if len(self.view.format) == 1:
22612  */
22613  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 495, __pyx_L1_error)
22614  __Pyx_GOTREF(__pyx_tuple__14);
22615  __Pyx_GIVEREF(__pyx_tuple__14);
22616 
22617  /* "View.MemoryView":520
22618  * def __getbuffer__(self, Py_buffer *info, int flags):
22619  * if flags & PyBUF_WRITABLE and self.view.readonly:
22620  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
22621  *
22622  * if flags & PyBUF_ND:
22623  */
22624  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 520, __pyx_L1_error)
22625  __Pyx_GOTREF(__pyx_tuple__15);
22626  __Pyx_GIVEREF(__pyx_tuple__15);
22627 
22628  /* "View.MemoryView":570
22629  * if self.view.strides == NULL:
22630  *
22631  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
22632  *
22633  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
22634  */
22635  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 570, __pyx_L1_error)
22636  __Pyx_GOTREF(__pyx_tuple__16);
22637  __Pyx_GIVEREF(__pyx_tuple__16);
22638 
22639  /* "View.MemoryView":577
22640  * def suboffsets(self):
22641  * if self.view.suboffsets == NULL:
22642  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
22643  *
22644  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22645  */
22646  __pyx_tuple__17 = PyTuple_New(1); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 577, __pyx_L1_error)
22647  __Pyx_GOTREF(__pyx_tuple__17);
22648  __Pyx_INCREF(__pyx_int_neg_1);
22649  __Pyx_GIVEREF(__pyx_int_neg_1);
22650  PyTuple_SET_ITEM(__pyx_tuple__17, 0, __pyx_int_neg_1);
22651  __Pyx_GIVEREF(__pyx_tuple__17);
22652 
22653  /* "(tree fragment)":2
22654  * def __reduce_cython__(self):
22655  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22656  * def __setstate_cython__(self, __pyx_state):
22657  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22658  */
22659  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 2, __pyx_L1_error)
22660  __Pyx_GOTREF(__pyx_tuple__18);
22661  __Pyx_GIVEREF(__pyx_tuple__18);
22662 
22663  /* "(tree fragment)":4
22664  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22665  * def __setstate_cython__(self, __pyx_state):
22666  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22667  */
22668  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 4, __pyx_L1_error)
22669  __Pyx_GOTREF(__pyx_tuple__19);
22670  __Pyx_GIVEREF(__pyx_tuple__19);
22671 
22672  /* "View.MemoryView":682
22673  * if item is Ellipsis:
22674  * if not seen_ellipsis:
22675  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
22676  * seen_ellipsis = True
22677  * else:
22678  */
22679  __pyx_slice__20 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(2, 682, __pyx_L1_error)
22680  __Pyx_GOTREF(__pyx_slice__20);
22681  __Pyx_GIVEREF(__pyx_slice__20);
22682 
22683  /* "View.MemoryView":703
22684  * for suboffset in suboffsets[:ndim]:
22685  * if suboffset >= 0:
22686  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
22687  *
22688  *
22689  */
22690  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 703, __pyx_L1_error)
22691  __Pyx_GOTREF(__pyx_tuple__21);
22692  __Pyx_GIVEREF(__pyx_tuple__21);
22693 
22694  /* "(tree fragment)":2
22695  * def __reduce_cython__(self):
22696  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22697  * def __setstate_cython__(self, __pyx_state):
22698  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22699  */
22700  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 2, __pyx_L1_error)
22701  __Pyx_GOTREF(__pyx_tuple__22);
22702  __Pyx_GIVEREF(__pyx_tuple__22);
22703 
22704  /* "(tree fragment)":4
22705  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22706  * def __setstate_cython__(self, __pyx_state):
22707  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22708  */
22709  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 4, __pyx_L1_error)
22710  __Pyx_GOTREF(__pyx_tuple__23);
22711  __Pyx_GIVEREF(__pyx_tuple__23);
22712 
22713  /* "cpartitioning.pyx":19
22714  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
22715  *
22716  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
22717  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22718  * c_partitionElements(comm.ob_mpi,
22719  */
22720  __pyx_tuple__29 = PyTuple_Pack(4, __pyx_n_s_comm, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 19, __pyx_L1_error)
22721  __Pyx_GOTREF(__pyx_tuple__29);
22722  __Pyx_GIVEREF(__pyx_tuple__29);
22723  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionElements, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 19, __pyx_L1_error)
22724 
22725  /* "cpartitioning.pyx":35
22726  * )
22727  *
22728  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
22729  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22730  * c_partitionNodes(comm.ob_mpi,
22731  */
22732  __pyx_tuple__31 = PyTuple_Pack(4, __pyx_n_s_comm, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 35, __pyx_L1_error)
22733  __Pyx_GOTREF(__pyx_tuple__31);
22734  __Pyx_GIVEREF(__pyx_tuple__31);
22735  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionNodes, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 35, __pyx_L1_error)
22736 
22737  /* "cpartitioning.pyx":51
22738  * )
22739  *
22740  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
22741  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
22742  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22743  */
22744  __pyx_tuple__33 = PyTuple_Pack(3, __pyx_n_s_comm, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 51, __pyx_L1_error)
22745  __Pyx_GOTREF(__pyx_tuple__33);
22746  __Pyx_GIVEREF(__pyx_tuple__33);
22747  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_convertPUMIPartitionToPython, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 51, __pyx_L1_error)
22748 
22749  /* "cpartitioning.pyx":65
22750  * )
22751  *
22752  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
22753  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22754  * if not isinstance(filebase, bytes):
22755  */
22756  __pyx_tuple__35 = PyTuple_Pack(6, __pyx_n_s_comm, __pyx_n_s_filebase, __pyx_n_s_indexBase, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 65, __pyx_L1_error)
22757  __Pyx_GOTREF(__pyx_tuple__35);
22758  __Pyx_GIVEREF(__pyx_tuple__35);
22759  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionNodesFromTetgenFiles, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 65, __pyx_L1_error)
22760 
22761  /* "cpartitioning.pyx":85
22762  * )
22763  *
22764  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
22765  * int nSpace,
22766  * cmeshTools.CMesh cmesh,
22767  */
22768  __pyx_tuple__37 = PyTuple_Pack(19, __pyx_n_s_comm, __pyx_n_s_nSpace, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_nodeOffsets_subdomain_owned, __pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_n_s_edgeOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_nodeNumbering_subdomain2global, __pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_n_s_edgeNumbering_subdomain2global, __pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_n_s_quadratic_subdomain_l2g, __pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_n_s_quadratic_lagrangeNodes, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 85, __pyx_L1_error)
22769  __Pyx_GOTREF(__pyx_tuple__37);
22770  __Pyx_GIVEREF(__pyx_tuple__37);
22771  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(16, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildQuadraticLocal2GlobalMappin, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 85, __pyx_L1_error)
22772 
22773  /* "cpartitioning.pyx":150
22774  * max_dof_neighbors)
22775  *
22776  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
22777  * int nSpace,
22778  * cmeshTools.CMesh cmesh,
22779  */
22780  __pyx_tuple__39 = PyTuple_Pack(19, __pyx_n_s_comm, __pyx_n_s_nSpace, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_nodeOffsets_subdomain_owned, __pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_n_s_edgeOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_nodeNumbering_subdomain2global, __pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_n_s_edgeNumbering_subdomain2global, __pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_n_s_quadratic_subdomain_l2g, __pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_n_s_quadratic_lagrangeNodes, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 150, __pyx_L1_error)
22781  __Pyx_GOTREF(__pyx_tuple__39);
22782  __Pyx_GIVEREF(__pyx_tuple__39);
22783  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(16, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildQuadraticCubeLocal2GlobalMa, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 150, __pyx_L1_error)
22784 
22785  /* "cpartitioning.pyx":191
22786  * max_dof_neighbors)
22787  *
22788  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
22789  * int nDOF_element,
22790  * cmeshTools.CMesh cmesh,
22791  */
22792  __pyx_tuple__41 = PyTuple_Pack(12, __pyx_n_s_comm, __pyx_n_s_nDOF_element, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_dg_dof_offsets_subdomain_owned, __pyx_n_s_dg_subdomain_l2g, __pyx_n_s_dgNumbering_subdomain2global, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 191, __pyx_L1_error)
22793  __Pyx_GOTREF(__pyx_tuple__41);
22794  __Pyx_GIVEREF(__pyx_tuple__41);
22795  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildDiscontinuousGalerkinLocal2, 191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 191, __pyx_L1_error)
22796 
22797  /* "View.MemoryView":286
22798  * return self.name
22799  *
22800  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
22801  * cdef strided = Enum("<strided and direct>") # default
22802  * cdef indirect = Enum("<strided and indirect>")
22803  */
22804  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 286, __pyx_L1_error)
22805  __Pyx_GOTREF(__pyx_tuple__43);
22806  __Pyx_GIVEREF(__pyx_tuple__43);
22807 
22808  /* "View.MemoryView":287
22809  *
22810  * cdef generic = Enum("<strided and direct or indirect>")
22811  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
22812  * cdef indirect = Enum("<strided and indirect>")
22813  *
22814  */
22815  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(2, 287, __pyx_L1_error)
22816  __Pyx_GOTREF(__pyx_tuple__44);
22817  __Pyx_GIVEREF(__pyx_tuple__44);
22818 
22819  /* "View.MemoryView":288
22820  * cdef generic = Enum("<strided and direct or indirect>")
22821  * cdef strided = Enum("<strided and direct>") # default
22822  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
22823  *
22824  *
22825  */
22826  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(2, 288, __pyx_L1_error)
22827  __Pyx_GOTREF(__pyx_tuple__45);
22828  __Pyx_GIVEREF(__pyx_tuple__45);
22829 
22830  /* "View.MemoryView":291
22831  *
22832  *
22833  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
22834  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
22835  *
22836  */
22837  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(2, 291, __pyx_L1_error)
22838  __Pyx_GOTREF(__pyx_tuple__46);
22839  __Pyx_GIVEREF(__pyx_tuple__46);
22840 
22841  /* "View.MemoryView":292
22842  *
22843  * cdef contiguous = Enum("<contiguous and direct>")
22844  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
22845  *
22846  *
22847  */
22848  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 292, __pyx_L1_error)
22849  __Pyx_GOTREF(__pyx_tuple__47);
22850  __Pyx_GIVEREF(__pyx_tuple__47);
22851 
22852  /* "(tree fragment)":1
22853  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22854  * cdef object __pyx_PickleError
22855  * cdef object __pyx_result
22856  */
22857  __pyx_tuple__48 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(2, 1, __pyx_L1_error)
22858  __Pyx_GOTREF(__pyx_tuple__48);
22859  __Pyx_GIVEREF(__pyx_tuple__48);
22860  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(2, 1, __pyx_L1_error)
22861  __Pyx_RefNannyFinishContext();
22862  return 0;
22863  __pyx_L1_error:;
22864  __Pyx_RefNannyFinishContext();
22865  return -1;
22866 }
22867 
22868 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
22869  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22870  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22871  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22872  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
22873  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22874  return 0;
22875  __pyx_L1_error:;
22876  return -1;
22877 }
22878 
22879 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
22880 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
22881 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
22882 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
22883 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
22884 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
22885 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
22886 
22887 static int __Pyx_modinit_global_init_code(void) {
22888  __Pyx_RefNannyDeclarations
22889  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
22890  /*--- Global init code ---*/
22891  generic = Py_None; Py_INCREF(Py_None);
22892  strided = Py_None; Py_INCREF(Py_None);
22893  indirect = Py_None; Py_INCREF(Py_None);
22894  contiguous = Py_None; Py_INCREF(Py_None);
22895  indirect_contiguous = Py_None; Py_INCREF(Py_None);
22896  __Pyx_RefNannyFinishContext();
22897  return 0;
22898 }
22899 
22900 static int __Pyx_modinit_variable_export_code(void) {
22901  __Pyx_RefNannyDeclarations
22902  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
22903  /*--- Variable export code ---*/
22904  __Pyx_RefNannyFinishContext();
22905  return 0;
22906 }
22907 
22908 static int __Pyx_modinit_function_export_code(void) {
22909  __Pyx_RefNannyDeclarations
22910  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
22911  /*--- Function export code ---*/
22912  __Pyx_RefNannyFinishContext();
22913  return 0;
22914 }
22915 
22916 static int __Pyx_modinit_type_init_code(void) {
22917  __Pyx_RefNannyDeclarations
22918  int __pyx_lineno = 0;
22919  const char *__pyx_filename = NULL;
22920  int __pyx_clineno = 0;
22921  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
22922  /*--- Type init code ---*/
22923  __pyx_vtabptr_array = &__pyx_vtable_array;
22924  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
22925  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
22926  #if PY_VERSION_HEX < 0x030800B1
22927  __pyx_type___pyx_array.tp_print = 0;
22928  #endif
22929  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
22930  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
22931  __pyx_array_type = &__pyx_type___pyx_array;
22932  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
22933  #if PY_VERSION_HEX < 0x030800B1
22934  __pyx_type___pyx_MemviewEnum.tp_print = 0;
22935  #endif
22936  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
22937  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22938  }
22939  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
22940  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
22941  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
22942  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
22943  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
22944  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
22945  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
22946  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
22947  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
22948  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
22949  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
22950  #if PY_VERSION_HEX < 0x030800B1
22951  __pyx_type___pyx_memoryview.tp_print = 0;
22952  #endif
22953  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
22954  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22955  }
22956  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
22957  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
22958  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
22959  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
22960  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
22961  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
22962  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
22963  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
22964  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
22965  #if PY_VERSION_HEX < 0x030800B1
22966  __pyx_type___pyx_memoryviewslice.tp_print = 0;
22967  #endif
22968  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
22969  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22970  }
22971  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
22972  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
22973  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
22974  __Pyx_RefNannyFinishContext();
22975  return 0;
22976  __pyx_L1_error:;
22977  __Pyx_RefNannyFinishContext();
22978  return -1;
22979 }
22980 
22981 static int __Pyx_modinit_type_import_code(void) {
22982  __Pyx_RefNannyDeclarations
22983  PyObject *__pyx_t_1 = NULL;
22984  int __pyx_lineno = 0;
22985  const char *__pyx_filename = NULL;
22986  int __pyx_clineno = 0;
22987  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
22988  /*--- Type import code ---*/
22989  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
22990  __Pyx_GOTREF(__pyx_t_1);
22991  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
22992  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
22993  sizeof(PyTypeObject),
22994  #else
22995  sizeof(PyHeapTypeObject),
22996  #endif
22997  __Pyx_ImportType_CheckSize_Warn);
22998  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
22999  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23000  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 207, __pyx_L1_error)
23001  __Pyx_GOTREF(__pyx_t_1);
23002  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23003  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 207, __pyx_L1_error)
23004  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
23005  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 230, __pyx_L1_error)
23006  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
23007  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 234, __pyx_L1_error)
23008  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23009  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 246, __pyx_L1_error)
23010  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
23011  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 839, __pyx_L1_error)
23012  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23013  __pyx_t_1 = PyImport_ImportModule("mpi4py.MPI"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 28, __pyx_L1_error)
23014  __Pyx_GOTREF(__pyx_t_1);
23015  __pyx_ptype_6mpi4py_3MPI_Status = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Status", sizeof(struct PyMPIStatusObject), __Pyx_ImportType_CheckSize_Warn);
23016  if (!__pyx_ptype_6mpi4py_3MPI_Status) __PYX_ERR(4, 28, __pyx_L1_error)
23017  __pyx_ptype_6mpi4py_3MPI_Datatype = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Datatype", sizeof(struct PyMPIDatatypeObject), __Pyx_ImportType_CheckSize_Warn);
23018  if (!__pyx_ptype_6mpi4py_3MPI_Datatype) __PYX_ERR(4, 35, __pyx_L1_error)
23019  __pyx_ptype_6mpi4py_3MPI_Request = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Request", sizeof(struct PyMPIRequestObject), __Pyx_ImportType_CheckSize_Warn);
23020  if (!__pyx_ptype_6mpi4py_3MPI_Request) __PYX_ERR(4, 42, __pyx_L1_error)
23021  __pyx_ptype_6mpi4py_3MPI_Prequest = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Prequest", sizeof(struct PyMPIPrequestObject), __Pyx_ImportType_CheckSize_Warn);
23022  if (!__pyx_ptype_6mpi4py_3MPI_Prequest) __PYX_ERR(4, 50, __pyx_L1_error)
23023  __pyx_ptype_6mpi4py_3MPI_Grequest = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Grequest", sizeof(struct PyMPIGrequestObject), __Pyx_ImportType_CheckSize_Warn);
23024  if (!__pyx_ptype_6mpi4py_3MPI_Grequest) __PYX_ERR(4, 56, __pyx_L1_error)
23025  __pyx_ptype_6mpi4py_3MPI_Message = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Message", sizeof(struct PyMPIMessageObject), __Pyx_ImportType_CheckSize_Warn);
23026  if (!__pyx_ptype_6mpi4py_3MPI_Message) __PYX_ERR(4, 62, __pyx_L1_error)
23027  __pyx_ptype_6mpi4py_3MPI_Op = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Op", sizeof(struct PyMPIOpObject), __Pyx_ImportType_CheckSize_Warn);
23028  if (!__pyx_ptype_6mpi4py_3MPI_Op) __PYX_ERR(4, 70, __pyx_L1_error)
23029  __pyx_ptype_6mpi4py_3MPI_Group = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Group", sizeof(struct PyMPIGroupObject), __Pyx_ImportType_CheckSize_Warn);
23030  if (!__pyx_ptype_6mpi4py_3MPI_Group) __PYX_ERR(4, 79, __pyx_L1_error)
23031  __pyx_ptype_6mpi4py_3MPI_Info = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Info", sizeof(struct PyMPIInfoObject), __Pyx_ImportType_CheckSize_Warn);
23032  if (!__pyx_ptype_6mpi4py_3MPI_Info) __PYX_ERR(4, 86, __pyx_L1_error)
23033  __pyx_ptype_6mpi4py_3MPI_Errhandler = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Errhandler", sizeof(struct PyMPIErrhandlerObject), __Pyx_ImportType_CheckSize_Warn);
23034  if (!__pyx_ptype_6mpi4py_3MPI_Errhandler) __PYX_ERR(4, 93, __pyx_L1_error)
23035  __pyx_ptype_6mpi4py_3MPI_Comm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Comm", sizeof(struct PyMPICommObject), __Pyx_ImportType_CheckSize_Warn);
23036  if (!__pyx_ptype_6mpi4py_3MPI_Comm) __PYX_ERR(4, 100, __pyx_L1_error)
23037  __pyx_ptype_6mpi4py_3MPI_Intracomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Intracomm", sizeof(struct PyMPIIntracommObject), __Pyx_ImportType_CheckSize_Warn);
23038  if (!__pyx_ptype_6mpi4py_3MPI_Intracomm) __PYX_ERR(4, 107, __pyx_L1_error)
23039  __pyx_ptype_6mpi4py_3MPI_Topocomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Topocomm", sizeof(struct PyMPITopocommObject), __Pyx_ImportType_CheckSize_Warn);
23040  if (!__pyx_ptype_6mpi4py_3MPI_Topocomm) __PYX_ERR(4, 113, __pyx_L1_error)
23041  __pyx_ptype_6mpi4py_3MPI_Cartcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Cartcomm", sizeof(struct PyMPICartcommObject), __Pyx_ImportType_CheckSize_Warn);
23042  if (!__pyx_ptype_6mpi4py_3MPI_Cartcomm) __PYX_ERR(4, 119, __pyx_L1_error)
23043  __pyx_ptype_6mpi4py_3MPI_Graphcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Graphcomm", sizeof(struct PyMPIGraphcommObject), __Pyx_ImportType_CheckSize_Warn);
23044  if (!__pyx_ptype_6mpi4py_3MPI_Graphcomm) __PYX_ERR(4, 125, __pyx_L1_error)
23045  __pyx_ptype_6mpi4py_3MPI_Distgraphcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Distgraphcomm", sizeof(struct PyMPIDistgraphcommObject), __Pyx_ImportType_CheckSize_Warn);
23046  if (!__pyx_ptype_6mpi4py_3MPI_Distgraphcomm) __PYX_ERR(4, 131, __pyx_L1_error)
23047  __pyx_ptype_6mpi4py_3MPI_Intercomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Intercomm", sizeof(struct PyMPIIntercommObject), __Pyx_ImportType_CheckSize_Warn);
23048  if (!__pyx_ptype_6mpi4py_3MPI_Intercomm) __PYX_ERR(4, 137, __pyx_L1_error)
23049  __pyx_ptype_6mpi4py_3MPI_Win = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Win", sizeof(struct PyMPIWinObject), __Pyx_ImportType_CheckSize_Warn);
23050  if (!__pyx_ptype_6mpi4py_3MPI_Win) __PYX_ERR(4, 143, __pyx_L1_error)
23051  __pyx_ptype_6mpi4py_3MPI_File = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "File", sizeof(struct PyMPIFileObject), __Pyx_ImportType_CheckSize_Warn);
23052  if (!__pyx_ptype_6mpi4py_3MPI_File) __PYX_ERR(4, 151, __pyx_L1_error)
23053  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23054  __pyx_t_1 = PyImport_ImportModule("proteus.cmeshTools"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5, __pyx_L1_error)
23055  __Pyx_GOTREF(__pyx_t_1);
23056  __pyx_ptype_7proteus_10cmeshTools_CMesh = __Pyx_ImportType(__pyx_t_1, "proteus.cmeshTools", "CMesh", sizeof(struct __pyx_obj_7proteus_10cmeshTools_CMesh), __Pyx_ImportType_CheckSize_Warn);
23057  if (!__pyx_ptype_7proteus_10cmeshTools_CMesh) __PYX_ERR(5, 5, __pyx_L1_error)
23058  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23059  __Pyx_RefNannyFinishContext();
23060  return 0;
23061  __pyx_L1_error:;
23062  __Pyx_XDECREF(__pyx_t_1);
23063  __Pyx_RefNannyFinishContext();
23064  return -1;
23065 }
23066 
23067 static int __Pyx_modinit_variable_import_code(void) {
23068  __Pyx_RefNannyDeclarations
23069  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
23070  /*--- Variable import code ---*/
23071  __Pyx_RefNannyFinishContext();
23072  return 0;
23073 }
23074 
23075 static int __Pyx_modinit_function_import_code(void) {
23076  __Pyx_RefNannyDeclarations
23077  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
23078  /*--- Function import code ---*/
23079  __Pyx_RefNannyFinishContext();
23080  return 0;
23081 }
23082 
23083 
23084 #ifndef CYTHON_NO_PYINIT_EXPORT
23085 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23086 #elif PY_MAJOR_VERSION < 3
23087 #ifdef __cplusplus
23088 #define __Pyx_PyMODINIT_FUNC extern "C" void
23089 #else
23090 #define __Pyx_PyMODINIT_FUNC void
23091 #endif
23092 #else
23093 #ifdef __cplusplus
23094 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
23095 #else
23096 #define __Pyx_PyMODINIT_FUNC PyObject *
23097 #endif
23098 #endif
23099 
23100 
23101 #if PY_MAJOR_VERSION < 3
23102 __Pyx_PyMODINIT_FUNC initcpartitioning(void) CYTHON_SMALL_CODE; /*proto*/
23103 __Pyx_PyMODINIT_FUNC initcpartitioning(void)
23104 #else
23105 __Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void) CYTHON_SMALL_CODE; /*proto*/
23106 __Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void)
23107 #if CYTHON_PEP489_MULTI_PHASE_INIT
23108 {
23109  return PyModuleDef_Init(&__pyx_moduledef);
23110 }
23111 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
23112  #if PY_VERSION_HEX >= 0x030700A1
23113  static PY_INT64_T main_interpreter_id = -1;
23114  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23115  if (main_interpreter_id == -1) {
23116  main_interpreter_id = current_id;
23117  return (unlikely(current_id == -1)) ? -1 : 0;
23118  } else if (unlikely(main_interpreter_id != current_id))
23119  #else
23120  static PyInterpreterState *main_interpreter = NULL;
23121  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23122  if (!main_interpreter) {
23123  main_interpreter = current_interpreter;
23124  } else if (unlikely(main_interpreter != current_interpreter))
23125  #endif
23126  {
23127  PyErr_SetString(
23128  PyExc_ImportError,
23129  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23130  return -1;
23131  }
23132  return 0;
23133 }
23134 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
23135  PyObject *value = PyObject_GetAttrString(spec, from_name);
23136  int result = 0;
23137  if (likely(value)) {
23138  if (allow_none || value != Py_None) {
23139  result = PyDict_SetItemString(moddict, to_name, value);
23140  }
23141  Py_DECREF(value);
23142  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23143  PyErr_Clear();
23144  } else {
23145  result = -1;
23146  }
23147  return result;
23148 }
23149 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23150  PyObject *module = NULL, *moddict, *modname;
23151  if (__Pyx_check_single_interpreter())
23152  return NULL;
23153  if (__pyx_m)
23154  return __Pyx_NewRef(__pyx_m);
23155  modname = PyObject_GetAttrString(spec, "name");
23156  if (unlikely(!modname)) goto bad;
23157  module = PyModule_NewObject(modname);
23158  Py_DECREF(modname);
23159  if (unlikely(!module)) goto bad;
23160  moddict = PyModule_GetDict(module);
23161  if (unlikely(!moddict)) goto bad;
23162  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
23163  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
23164  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
23165  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
23166  return module;
23167 bad:
23168  Py_XDECREF(module);
23169  return NULL;
23170 }
23171 
23172 
23173 static CYTHON_SMALL_CODE int __pyx_pymod_exec_cpartitioning(PyObject *__pyx_pyinit_module)
23174 #endif
23175 #endif
23176 {
23177  PyObject *__pyx_t_1 = NULL;
23178  PyObject *__pyx_t_2 = NULL;
23179  static PyThread_type_lock __pyx_t_3[8];
23180  int __pyx_lineno = 0;
23181  const char *__pyx_filename = NULL;
23182  int __pyx_clineno = 0;
23183  __Pyx_RefNannyDeclarations
23184  #if CYTHON_PEP489_MULTI_PHASE_INIT
23185  if (__pyx_m) {
23186  if (__pyx_m == __pyx_pyinit_module) return 0;
23187  PyErr_SetString(PyExc_RuntimeError, "Module 'cpartitioning' has already been imported. Re-initialisation is not supported.");
23188  return -1;
23189  }
23190  #elif PY_MAJOR_VERSION >= 3
23191  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
23192  #endif
23193  #if CYTHON_REFNANNY
23194 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
23195 if (!__Pyx_RefNanny) {
23196  PyErr_Clear();
23197  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
23198  if (!__Pyx_RefNanny)
23199  Py_FatalError("failed to import 'refnanny' module");
23200 }
23201 #endif
23202  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void)", 0);
23203  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23204  #ifdef __Pxy_PyFrame_Initialize_Offsets
23205  __Pxy_PyFrame_Initialize_Offsets();
23206  #endif
23207  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23208  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23209  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23210  #ifdef __Pyx_CyFunction_USED
23211  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23212  #endif
23213  #ifdef __Pyx_FusedFunction_USED
23214  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23215  #endif
23216  #ifdef __Pyx_Coroutine_USED
23217  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23218  #endif
23219  #ifdef __Pyx_Generator_USED
23220  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23221  #endif
23222  #ifdef __Pyx_AsyncGen_USED
23223  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23224  #endif
23225  #ifdef __Pyx_StopAsyncIteration_USED
23226  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23227  #endif
23228  /*--- Library function declarations ---*/
23229  /*--- Threads initialization code ---*/
23230  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23231  #ifdef WITH_THREAD /* Python build with threading support? */
23232  PyEval_InitThreads();
23233  #endif
23234  #endif
23235  /*--- Module creation code ---*/
23236  #if CYTHON_PEP489_MULTI_PHASE_INIT
23237  __pyx_m = __pyx_pyinit_module;
23238  Py_INCREF(__pyx_m);
23239  #else
23240  #if PY_MAJOR_VERSION < 3
23241  __pyx_m = Py_InitModule4("cpartitioning", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23242  #else
23243  __pyx_m = PyModule_Create(&__pyx_moduledef);
23244  #endif
23245  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23246  #endif
23247  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23248  Py_INCREF(__pyx_d);
23249  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23250  Py_INCREF(__pyx_b);
23251  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23252  Py_INCREF(__pyx_cython_runtime);
23253  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23254  /*--- Initialize various global constants etc. ---*/
23255  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23256  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23257  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23258  #endif
23259  if (__pyx_module_is_main_cpartitioning) {
23260  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23261  }
23262  #if PY_MAJOR_VERSION >= 3
23263  {
23264  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23265  if (!PyDict_GetItemString(modules, "cpartitioning")) {
23266  if (unlikely(PyDict_SetItemString(modules, "cpartitioning", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23267  }
23268  }
23269  #endif
23270  /*--- Builtin init code ---*/
23271  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23272  /*--- Constants init code ---*/
23273  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23274  /*--- Global type/function init code ---*/
23275  (void)__Pyx_modinit_global_init_code();
23276  (void)__Pyx_modinit_variable_export_code();
23277  (void)__Pyx_modinit_function_export_code();
23278  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23279  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23280  (void)__Pyx_modinit_variable_import_code();
23281  (void)__Pyx_modinit_function_import_code();
23282  /*--- Execution code ---*/
23283  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23284  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23285  #endif
23286 
23287  /* "cpartitioning.pyx":2
23288  * # A type of -*- python -*- file
23289  * from proteus import Comm as proteus_Comm # <<<<<<<<<<<<<<
23290  * import numpy as np
23291  * cimport numpy as np
23292  */
23293  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
23294  __Pyx_GOTREF(__pyx_t_1);
23295  __Pyx_INCREF(__pyx_n_s_Comm);
23296  __Pyx_GIVEREF(__pyx_n_s_Comm);
23297  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Comm);
23298  __pyx_t_2 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error)
23299  __Pyx_GOTREF(__pyx_t_2);
23300  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23301  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Comm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
23302  __Pyx_GOTREF(__pyx_t_1);
23303  if (PyDict_SetItem(__pyx_d, __pyx_n_s_proteus_Comm, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
23304  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23305  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23306 
23307  /* "cpartitioning.pyx":3
23308  * # A type of -*- python -*- file
23309  * from proteus import Comm as proteus_Comm
23310  * import numpy as np # <<<<<<<<<<<<<<
23311  * cimport numpy as np
23312  * from mpi4py.MPI cimport (Comm,
23313  */
23314  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
23315  __Pyx_GOTREF(__pyx_t_2);
23316  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
23317  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23318 
23319  /* "cpartitioning.pyx":19
23320  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
23321  *
23322  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23323  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23324  * c_partitionElements(comm.ob_mpi,
23325  */
23326  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_1partitionElements, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
23327  __Pyx_GOTREF(__pyx_t_2);
23328  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionElements, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
23329  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23330 
23331  /* "cpartitioning.pyx":35
23332  * )
23333  *
23334  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23335  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23336  * c_partitionNodes(comm.ob_mpi,
23337  */
23338  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_3partitionNodes, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
23339  __Pyx_GOTREF(__pyx_t_2);
23340  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionNodes, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
23341  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23342 
23343  /* "cpartitioning.pyx":51
23344  * )
23345  *
23346  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23347  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
23348  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23349  */
23350  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_5convertPUMIPartitionToPython, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
23351  __Pyx_GOTREF(__pyx_t_2);
23352  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convertPUMIPartitionToPython, __pyx_t_2) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
23353  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23354 
23355  /* "cpartitioning.pyx":65
23356  * )
23357  *
23358  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23359  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23360  * if not isinstance(filebase, bytes):
23361  */
23362  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_7partitionNodesFromTetgenFiles, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
23363  __Pyx_GOTREF(__pyx_t_2);
23364  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionNodesFromTetgenFiles, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
23365  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23366 
23367  /* "cpartitioning.pyx":85
23368  * )
23369  *
23370  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23371  * int nSpace,
23372  * cmeshTools.CMesh cmesh,
23373  */
23374  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_9buildQuadraticLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
23375  __Pyx_GOTREF(__pyx_t_2);
23376  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildQuadraticLocal2GlobalMappin, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
23377  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23378 
23379  /* "cpartitioning.pyx":150
23380  * max_dof_neighbors)
23381  *
23382  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23383  * int nSpace,
23384  * cmeshTools.CMesh cmesh,
23385  */
23386  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_11buildQuadraticCubeLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
23387  __Pyx_GOTREF(__pyx_t_2);
23388  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildQuadraticCubeLocal2GlobalMa, __pyx_t_2) < 0) __PYX_ERR(0, 150, __pyx_L1_error)
23389  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23390 
23391  /* "cpartitioning.pyx":191
23392  * max_dof_neighbors)
23393  *
23394  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23395  * int nDOF_element,
23396  * cmeshTools.CMesh cmesh,
23397  */
23398  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_13buildDiscontinuousGalerkinLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
23399  __Pyx_GOTREF(__pyx_t_2);
23400  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildDiscontinuousGalerkinLocal2, __pyx_t_2) < 0) __PYX_ERR(0, 191, __pyx_L1_error)
23401  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23402 
23403  /* "cpartitioning.pyx":1
23404  * # A type of -*- python -*- file # <<<<<<<<<<<<<<
23405  * from proteus import Comm as proteus_Comm
23406  * import numpy as np
23407  */
23408  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
23409  __Pyx_GOTREF(__pyx_t_2);
23410  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23411  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23412 
23413  /* "View.MemoryView":209
23414  * info.obj = self
23415  *
23416  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23417  *
23418  * def __dealloc__(array self):
23419  */
23420  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 209, __pyx_L1_error)
23421  __Pyx_GOTREF(__pyx_t_2);
23422  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 209, __pyx_L1_error)
23423  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23424  PyType_Modified(__pyx_array_type);
23425 
23426  /* "View.MemoryView":286
23427  * return self.name
23428  *
23429  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23430  * cdef strided = Enum("<strided and direct>") # default
23431  * cdef indirect = Enum("<strided and indirect>")
23432  */
23433  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 286, __pyx_L1_error)
23434  __Pyx_GOTREF(__pyx_t_2);
23435  __Pyx_XGOTREF(generic);
23436  __Pyx_DECREF_SET(generic, __pyx_t_2);
23437  __Pyx_GIVEREF(__pyx_t_2);
23438  __pyx_t_2 = 0;
23439 
23440  /* "View.MemoryView":287
23441  *
23442  * cdef generic = Enum("<strided and direct or indirect>")
23443  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23444  * cdef indirect = Enum("<strided and indirect>")
23445  *
23446  */
23447  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 287, __pyx_L1_error)
23448  __Pyx_GOTREF(__pyx_t_2);
23449  __Pyx_XGOTREF(strided);
23450  __Pyx_DECREF_SET(strided, __pyx_t_2);
23451  __Pyx_GIVEREF(__pyx_t_2);
23452  __pyx_t_2 = 0;
23453 
23454  /* "View.MemoryView":288
23455  * cdef generic = Enum("<strided and direct or indirect>")
23456  * cdef strided = Enum("<strided and direct>") # default
23457  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23458  *
23459  *
23460  */
23461  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 288, __pyx_L1_error)
23462  __Pyx_GOTREF(__pyx_t_2);
23463  __Pyx_XGOTREF(indirect);
23464  __Pyx_DECREF_SET(indirect, __pyx_t_2);
23465  __Pyx_GIVEREF(__pyx_t_2);
23466  __pyx_t_2 = 0;
23467 
23468  /* "View.MemoryView":291
23469  *
23470  *
23471  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23472  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23473  *
23474  */
23475  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 291, __pyx_L1_error)
23476  __Pyx_GOTREF(__pyx_t_2);
23477  __Pyx_XGOTREF(contiguous);
23478  __Pyx_DECREF_SET(contiguous, __pyx_t_2);
23479  __Pyx_GIVEREF(__pyx_t_2);
23480  __pyx_t_2 = 0;
23481 
23482  /* "View.MemoryView":292
23483  *
23484  * cdef contiguous = Enum("<contiguous and direct>")
23485  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23486  *
23487  *
23488  */
23489  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 292, __pyx_L1_error)
23490  __Pyx_GOTREF(__pyx_t_2);
23491  __Pyx_XGOTREF(indirect_contiguous);
23492  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
23493  __Pyx_GIVEREF(__pyx_t_2);
23494  __pyx_t_2 = 0;
23495 
23496  /* "View.MemoryView":316
23497  *
23498  * DEF THREAD_LOCKS_PREALLOCATED = 8
23499  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
23500  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
23501  * PyThread_allocate_lock(),
23502  */
23503  __pyx_memoryview_thread_locks_used = 0;
23504 
23505  /* "View.MemoryView":317
23506  * DEF THREAD_LOCKS_PREALLOCATED = 8
23507  * cdef int __pyx_memoryview_thread_locks_used = 0
23508  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
23509  * PyThread_allocate_lock(),
23510  * PyThread_allocate_lock(),
23511  */
23512  __pyx_t_3[0] = PyThread_allocate_lock();
23513  __pyx_t_3[1] = PyThread_allocate_lock();
23514  __pyx_t_3[2] = PyThread_allocate_lock();
23515  __pyx_t_3[3] = PyThread_allocate_lock();
23516  __pyx_t_3[4] = PyThread_allocate_lock();
23517  __pyx_t_3[5] = PyThread_allocate_lock();
23518  __pyx_t_3[6] = PyThread_allocate_lock();
23519  __pyx_t_3[7] = PyThread_allocate_lock();
23520  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23521 
23522  /* "View.MemoryView":549
23523  * info.obj = self
23524  *
23525  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23526  *
23527  *
23528  */
23529  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 549, __pyx_L1_error)
23530  __Pyx_GOTREF(__pyx_t_2);
23531  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 549, __pyx_L1_error)
23532  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23533  PyType_Modified(__pyx_memoryview_type);
23534 
23535  /* "View.MemoryView":995
23536  * return self.from_object
23537  *
23538  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23539  *
23540  *
23541  */
23542  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 995, __pyx_L1_error)
23543  __Pyx_GOTREF(__pyx_t_2);
23544  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 995, __pyx_L1_error)
23545  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23546  PyType_Modified(__pyx_memoryviewslice_type);
23547 
23548  /* "(tree fragment)":1
23549  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23550  * cdef object __pyx_PickleError
23551  * cdef object __pyx_result
23552  */
23553  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
23554  __Pyx_GOTREF(__pyx_t_2);
23555  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
23556  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23557 
23558  /* "BufferFormatFromTypeInfo":1463
23559  *
23560  * @cname('__pyx_format_from_typeinfo')
23561  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
23562  * cdef __Pyx_StructField *field
23563  * cdef __pyx_typeinfo_string fmt
23564  */
23565 
23566  /*--- Wrapped vars code ---*/
23567 
23568  goto __pyx_L0;
23569  __pyx_L1_error:;
23570  __Pyx_XDECREF(__pyx_t_1);
23571  __Pyx_XDECREF(__pyx_t_2);
23572  if (__pyx_m) {
23573  if (__pyx_d) {
23574  __Pyx_AddTraceback("init cpartitioning", __pyx_clineno, __pyx_lineno, __pyx_filename);
23575  }
23576  Py_CLEAR(__pyx_m);
23577  } else if (!PyErr_Occurred()) {
23578  PyErr_SetString(PyExc_ImportError, "init cpartitioning");
23579  }
23580  __pyx_L0:;
23581  __Pyx_RefNannyFinishContext();
23582  #if CYTHON_PEP489_MULTI_PHASE_INIT
23583  return (__pyx_m != NULL) ? 0 : -1;
23584  #elif PY_MAJOR_VERSION >= 3
23585  return __pyx_m;
23586  #else
23587  return;
23588  #endif
23589 }
23590 
23591 /* --- Runtime support code --- */
23592 /* Refnanny */
23593 #if CYTHON_REFNANNY
23594 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
23595  PyObject *m = NULL, *p = NULL;
23596  void *r = NULL;
23597  m = PyImport_ImportModule(modname);
23598  if (!m) goto end;
23599  p = PyObject_GetAttrString(m, "RefNannyAPI");
23600  if (!p) goto end;
23601  r = PyLong_AsVoidPtr(p);
23602 end:
23603  Py_XDECREF(p);
23604  Py_XDECREF(m);
23605  return (__Pyx_RefNannyAPIStruct *)r;
23606 }
23607 #endif
23608 
23609 /* RaiseArgTupleInvalid */
23610 static void __Pyx_RaiseArgtupleInvalid(
23611  const char* func_name,
23612  int exact,
23613  Py_ssize_t num_min,
23614  Py_ssize_t num_max,
23615  Py_ssize_t num_found)
23616 {
23617  Py_ssize_t num_expected;
23618  const char *more_or_less;
23619  if (num_found < num_min) {
23620  num_expected = num_min;
23621  more_or_less = "at least";
23622  } else {
23623  num_expected = num_max;
23624  more_or_less = "at most";
23625  }
23626  if (exact) {
23627  more_or_less = "exactly";
23628  }
23629  PyErr_Format(PyExc_TypeError,
23630  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
23631  func_name, more_or_less, num_expected,
23632  (num_expected == 1) ? "" : "s", num_found);
23633 }
23634 
23635 /* RaiseDoubleKeywords */
23636 static void __Pyx_RaiseDoubleKeywordsError(
23637  const char* func_name,
23638  PyObject* kw_name)
23639 {
23640  PyErr_Format(PyExc_TypeError,
23641  #if PY_MAJOR_VERSION >= 3
23642  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23643  #else
23644  "%s() got multiple values for keyword argument '%s'", func_name,
23645  PyString_AsString(kw_name));
23646  #endif
23647 }
23648 
23649 /* ParseKeywords */
23650 static int __Pyx_ParseOptionalKeywords(
23651  PyObject *kwds,
23652  PyObject **argnames[],
23653  PyObject *kwds2,
23654  PyObject *values[],
23655  Py_ssize_t num_pos_args,
23656  const char* function_name)
23657 {
23658  PyObject *key = 0, *value = 0;
23659  Py_ssize_t pos = 0;
23660  PyObject*** name;
23661  PyObject*** first_kw_arg = argnames + num_pos_args;
23662  while (PyDict_Next(kwds, &pos, &key, &value)) {
23663  name = first_kw_arg;
23664  while (*name && (**name != key)) name++;
23665  if (*name) {
23666  values[name-argnames] = value;
23667  continue;
23668  }
23669  name = first_kw_arg;
23670  #if PY_MAJOR_VERSION < 3
23671  if (likely(PyString_Check(key))) {
23672  while (*name) {
23673  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23674  && _PyString_Eq(**name, key)) {
23675  values[name-argnames] = value;
23676  break;
23677  }
23678  name++;
23679  }
23680  if (*name) continue;
23681  else {
23682  PyObject*** argname = argnames;
23683  while (argname != first_kw_arg) {
23684  if ((**argname == key) || (
23685  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23686  && _PyString_Eq(**argname, key))) {
23687  goto arg_passed_twice;
23688  }
23689  argname++;
23690  }
23691  }
23692  } else
23693  #endif
23694  if (likely(PyUnicode_Check(key))) {
23695  while (*name) {
23696  int cmp = (**name == key) ? 0 :
23697  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23698  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23699  #endif
23700  PyUnicode_Compare(**name, key);
23701  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23702  if (cmp == 0) {
23703  values[name-argnames] = value;
23704  break;
23705  }
23706  name++;
23707  }
23708  if (*name) continue;
23709  else {
23710  PyObject*** argname = argnames;
23711  while (argname != first_kw_arg) {
23712  int cmp = (**argname == key) ? 0 :
23713  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23714  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23715  #endif
23716  PyUnicode_Compare(**argname, key);
23717  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23718  if (cmp == 0) goto arg_passed_twice;
23719  argname++;
23720  }
23721  }
23722  } else
23723  goto invalid_keyword_type;
23724  if (kwds2) {
23725  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
23726  } else {
23727  goto invalid_keyword;
23728  }
23729  }
23730  return 0;
23731 arg_passed_twice:
23732  __Pyx_RaiseDoubleKeywordsError(function_name, key);
23733  goto bad;
23734 invalid_keyword_type:
23735  PyErr_Format(PyExc_TypeError,
23736  "%.200s() keywords must be strings", function_name);
23737  goto bad;
23738 invalid_keyword:
23739  PyErr_Format(PyExc_TypeError,
23740  #if PY_MAJOR_VERSION < 3
23741  "%.200s() got an unexpected keyword argument '%.200s'",
23742  function_name, PyString_AsString(key));
23743  #else
23744  "%s() got an unexpected keyword argument '%U'",
23745  function_name, key);
23746  #endif
23747 bad:
23748  return -1;
23749 }
23750 
23751 /* ArgTypeTest */
23752 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
23753 {
23754  if (unlikely(!type)) {
23755  PyErr_SetString(PyExc_SystemError, "Missing type object");
23756  return 0;
23757  }
23758  else if (exact) {
23759  #if PY_MAJOR_VERSION == 2
23760  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
23761  #endif
23762  }
23763  else {
23764  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
23765  }
23766  PyErr_Format(PyExc_TypeError,
23767  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
23768  name, type->tp_name, Py_TYPE(obj)->tp_name);
23769  return 0;
23770 }
23771 
23772 /* PyObjectGetAttrStr */
23773 #if CYTHON_USE_TYPE_SLOTS
23774 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23775  PyTypeObject* tp = Py_TYPE(obj);
23776  if (likely(tp->tp_getattro))
23777  return tp->tp_getattro(obj, attr_name);
23778 #if PY_MAJOR_VERSION < 3
23779  if (likely(tp->tp_getattr))
23780  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23781 #endif
23782  return PyObject_GetAttr(obj, attr_name);
23783 }
23784 #endif
23785 
23786 /* GetBuiltinName */
23787 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23788  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23789  if (unlikely(!result)) {
23790  PyErr_Format(PyExc_NameError,
23791 #if PY_MAJOR_VERSION >= 3
23792  "name '%U' is not defined", name);
23793 #else
23794  "name '%.200s' is not defined", PyString_AS_STRING(name));
23795 #endif
23796  }
23797  return result;
23798 }
23799 
23800 /* PyDictVersioning */
23801 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
23802 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
23803  PyObject *dict = Py_TYPE(obj)->tp_dict;
23804  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
23805 }
23806 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
23807  PyObject **dictptr = NULL;
23808  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
23809  if (offset) {
23810 #if CYTHON_COMPILING_IN_CPYTHON
23811  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
23812 #else
23813  dictptr = _PyObject_GetDictPtr(obj);
23814 #endif
23815  }
23816  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
23817 }
23818 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
23819  PyObject *dict = Py_TYPE(obj)->tp_dict;
23820  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
23821  return 0;
23822  return obj_dict_version == __Pyx_get_object_dict_version(obj);
23823 }
23824 #endif
23825 
23826 /* GetModuleGlobalName */
23827 #if CYTHON_USE_DICT_VERSIONS
23828 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
23829 #else
23830 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
23831 #endif
23832 {
23833  PyObject *result;
23834 #if !CYTHON_AVOID_BORROWED_REFS
23835 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
23836  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
23837  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23838  if (likely(result)) {
23839  return __Pyx_NewRef(result);
23840  } else if (unlikely(PyErr_Occurred())) {
23841  return NULL;
23842  }
23843 #else
23844  result = PyDict_GetItem(__pyx_d, name);
23845  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23846  if (likely(result)) {
23847  return __Pyx_NewRef(result);
23848  }
23849 #endif
23850 #else
23851  result = PyObject_GetItem(__pyx_d, name);
23852  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23853  if (likely(result)) {
23854  return __Pyx_NewRef(result);
23855  }
23856  PyErr_Clear();
23857 #endif
23858  return __Pyx_GetBuiltinName(name);
23859 }
23860 
23861 /* PyIntBinop */
23862 #if !CYTHON_COMPILING_IN_PYPY
23863 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
23864  (void)inplace;
23865  (void)zerodivision_check;
23866  #if PY_MAJOR_VERSION < 3
23867  if (likely(PyInt_CheckExact(op1))) {
23868  const long b = intval;
23869  long x;
23870  long a = PyInt_AS_LONG(op1);
23871  x = (long)((unsigned long)a + b);
23872  if (likely((x^a) >= 0 || (x^b) >= 0))
23873  return PyInt_FromLong(x);
23874  return PyLong_Type.tp_as_number->nb_add(op1, op2);
23875  }
23876  #endif
23877  #if CYTHON_USE_PYLONG_INTERNALS
23878  if (likely(PyLong_CheckExact(op1))) {
23879  const long b = intval;
23880  long a, x;
23881 #ifdef HAVE_LONG_LONG
23882  const PY_LONG_LONG llb = intval;
23883  PY_LONG_LONG lla, llx;
23884 #endif
23885  const digit* digits = ((PyLongObject*)op1)->ob_digit;
23886  const Py_ssize_t size = Py_SIZE(op1);
23887  if (likely(__Pyx_sst_abs(size) <= 1)) {
23888  a = likely(size) ? digits[0] : 0;
23889  if (size == -1) a = -a;
23890  } else {
23891  switch (size) {
23892  case -2:
23893  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
23894  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23895  break;
23896 #ifdef HAVE_LONG_LONG
23897  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23898  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23899  goto long_long;
23900 #endif
23901  }
23902  CYTHON_FALLTHROUGH;
23903  case 2:
23904  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
23905  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23906  break;
23907 #ifdef HAVE_LONG_LONG
23908  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23909  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23910  goto long_long;
23911 #endif
23912  }
23913  CYTHON_FALLTHROUGH;
23914  case -3:
23915  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
23916  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23917  break;
23918 #ifdef HAVE_LONG_LONG
23919  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23920  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23921  goto long_long;
23922 #endif
23923  }
23924  CYTHON_FALLTHROUGH;
23925  case 3:
23926  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
23927  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23928  break;
23929 #ifdef HAVE_LONG_LONG
23930  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23931  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23932  goto long_long;
23933 #endif
23934  }
23935  CYTHON_FALLTHROUGH;
23936  case -4:
23937  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
23938  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23939  break;
23940 #ifdef HAVE_LONG_LONG
23941  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23942  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23943  goto long_long;
23944 #endif
23945  }
23946  CYTHON_FALLTHROUGH;
23947  case 4:
23948  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
23949  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23950  break;
23951 #ifdef HAVE_LONG_LONG
23952  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23953  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23954  goto long_long;
23955 #endif
23956  }
23957  CYTHON_FALLTHROUGH;
23958  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
23959  }
23960  }
23961  x = a + b;
23962  return PyLong_FromLong(x);
23963 #ifdef HAVE_LONG_LONG
23964  long_long:
23965  llx = lla + llb;
23966  return PyLong_FromLongLong(llx);
23967 #endif
23968 
23969 
23970  }
23971  #endif
23972  if (PyFloat_CheckExact(op1)) {
23973  const long b = intval;
23974  double a = PyFloat_AS_DOUBLE(op1);
23975  double result;
23976  PyFPE_START_PROTECT("add", return NULL)
23977  result = ((double)a) + (double)b;
23978  PyFPE_END_PROTECT(result)
23979  return PyFloat_FromDouble(result);
23980  }
23981  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
23982 }
23983 #endif
23984 
23985 /* PyCFunctionFastCall */
23986 #if CYTHON_FAST_PYCCALL
23987 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
23988  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
23989  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
23990  PyObject *self = PyCFunction_GET_SELF(func);
23991  int flags = PyCFunction_GET_FLAGS(func);
23992  assert(PyCFunction_Check(func));
23993  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
23994  assert(nargs >= 0);
23995  assert(nargs == 0 || args != NULL);
23996  /* _PyCFunction_FastCallDict() must not be called with an exception set,
23997  because it may clear it (directly or indirectly) and so the
23998  caller loses its exception */
23999  assert(!PyErr_Occurred());
24000  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24001  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
24002  } else {
24003  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
24004  }
24005 }
24006 #endif
24007 
24008 /* PyFunctionFastCall */
24009 #if CYTHON_FAST_PYCALL
24010 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24011  PyObject *globals) {
24012  PyFrameObject *f;
24013  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24014  PyObject **fastlocals;
24015  Py_ssize_t i;
24016  PyObject *result;
24017  assert(globals != NULL);
24018  /* XXX Perhaps we should create a specialized
24019  PyFrame_New() that doesn't take locals, but does
24020  take builtins without sanity checking them.
24021  */
24022  assert(tstate != NULL);
24023  f = PyFrame_New(tstate, co, globals, NULL);
24024  if (f == NULL) {
24025  return NULL;
24026  }
24027  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
24028  for (i = 0; i < na; i++) {
24029  Py_INCREF(*args);
24030  fastlocals[i] = *args++;
24031  }
24032  result = PyEval_EvalFrameEx(f,0);
24033  ++tstate->recursion_depth;
24034  Py_DECREF(f);
24035  --tstate->recursion_depth;
24036  return result;
24037 }
24038 #if 1 || PY_VERSION_HEX < 0x030600B1
24039 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24040  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24041  PyObject *globals = PyFunction_GET_GLOBALS(func);
24042  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24043  PyObject *closure;
24044 #if PY_MAJOR_VERSION >= 3
24045  PyObject *kwdefs;
24046 #endif
24047  PyObject *kwtuple, **k;
24048  PyObject **d;
24049  Py_ssize_t nd;
24050  Py_ssize_t nk;
24051  PyObject *result;
24052  assert(kwargs == NULL || PyDict_Check(kwargs));
24053  nk = kwargs ? PyDict_Size(kwargs) : 0;
24054  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
24055  return NULL;
24056  }
24057  if (
24058 #if PY_MAJOR_VERSION >= 3
24059  co->co_kwonlyargcount == 0 &&
24060 #endif
24061  likely(kwargs == NULL || nk == 0) &&
24062  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24063  if (argdefs == NULL && co->co_argcount == nargs) {
24064  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24065  goto done;
24066  }
24067  else if (nargs == 0 && argdefs != NULL
24068  && co->co_argcount == Py_SIZE(argdefs)) {
24069  /* function called with no arguments, but all parameters have
24070  a default value: use default values as arguments .*/
24071  args = &PyTuple_GET_ITEM(argdefs, 0);
24072  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24073  goto done;
24074  }
24075  }
24076  if (kwargs != NULL) {
24077  Py_ssize_t pos, i;
24078  kwtuple = PyTuple_New(2 * nk);
24079  if (kwtuple == NULL) {
24080  result = NULL;
24081  goto done;
24082  }
24083  k = &PyTuple_GET_ITEM(kwtuple, 0);
24084  pos = i = 0;
24085  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24086  Py_INCREF(k[i]);
24087  Py_INCREF(k[i+1]);
24088  i += 2;
24089  }
24090  nk = i / 2;
24091  }
24092  else {
24093  kwtuple = NULL;
24094  k = NULL;
24095  }
24096  closure = PyFunction_GET_CLOSURE(func);
24097 #if PY_MAJOR_VERSION >= 3
24098  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24099 #endif
24100  if (argdefs != NULL) {
24101  d = &PyTuple_GET_ITEM(argdefs, 0);
24102  nd = Py_SIZE(argdefs);
24103  }
24104  else {
24105  d = NULL;
24106  nd = 0;
24107  }
24108 #if PY_MAJOR_VERSION >= 3
24109  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24110  args, (int)nargs,
24111  k, (int)nk,
24112  d, (int)nd, kwdefs, closure);
24113 #else
24114  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24115  args, (int)nargs,
24116  k, (int)nk,
24117  d, (int)nd, closure);
24118 #endif
24119  Py_XDECREF(kwtuple);
24120 done:
24121  Py_LeaveRecursiveCall();
24122  return result;
24123 }
24124 #endif
24125 #endif
24126 
24127 /* PyObjectCall */
24128 #if CYTHON_COMPILING_IN_CPYTHON
24129 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24130  PyObject *result;
24131  ternaryfunc call = func->ob_type->tp_call;
24132  if (unlikely(!call))
24133  return PyObject_Call(func, arg, kw);
24134  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24135  return NULL;
24136  result = (*call)(func, arg, kw);
24137  Py_LeaveRecursiveCall();
24138  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24139  PyErr_SetString(
24140  PyExc_SystemError,
24141  "NULL result without error in PyObject_Call");
24142  }
24143  return result;
24144 }
24145 #endif
24146 
24147 /* PyObjectCall2Args */
24148 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
24149  PyObject *args, *result = NULL;
24150  #if CYTHON_FAST_PYCALL
24151  if (PyFunction_Check(function)) {
24152  PyObject *args[2] = {arg1, arg2};
24153  return __Pyx_PyFunction_FastCall(function, args, 2);
24154  }
24155  #endif
24156  #if CYTHON_FAST_PYCCALL
24157  if (__Pyx_PyFastCFunction_Check(function)) {
24158  PyObject *args[2] = {arg1, arg2};
24159  return __Pyx_PyCFunction_FastCall(function, args, 2);
24160  }
24161  #endif
24162  args = PyTuple_New(2);
24163  if (unlikely(!args)) goto done;
24164  Py_INCREF(arg1);
24165  PyTuple_SET_ITEM(args, 0, arg1);
24166  Py_INCREF(arg2);
24167  PyTuple_SET_ITEM(args, 1, arg2);
24168  Py_INCREF(function);
24169  result = __Pyx_PyObject_Call(function, args, NULL);
24170  Py_DECREF(args);
24171  Py_DECREF(function);
24172 done:
24173  return result;
24174 }
24175 
24176 /* PyObjectCallMethO */
24177 #if CYTHON_COMPILING_IN_CPYTHON
24178 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24179  PyObject *self, *result;
24180  PyCFunction cfunc;
24181  cfunc = PyCFunction_GET_FUNCTION(func);
24182  self = PyCFunction_GET_SELF(func);
24183  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24184  return NULL;
24185  result = cfunc(self, arg);
24186  Py_LeaveRecursiveCall();
24187  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24188  PyErr_SetString(
24189  PyExc_SystemError,
24190  "NULL result without error in PyObject_Call");
24191  }
24192  return result;
24193 }
24194 #endif
24195 
24196 /* PyObjectCallOneArg */
24197 #if CYTHON_COMPILING_IN_CPYTHON
24198 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24199  PyObject *result;
24200  PyObject *args = PyTuple_New(1);
24201  if (unlikely(!args)) return NULL;
24202  Py_INCREF(arg);
24203  PyTuple_SET_ITEM(args, 0, arg);
24204  result = __Pyx_PyObject_Call(func, args, NULL);
24205  Py_DECREF(args);
24206  return result;
24207 }
24208 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24209 #if CYTHON_FAST_PYCALL
24210  if (PyFunction_Check(func)) {
24211  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24212  }
24213 #endif
24214  if (likely(PyCFunction_Check(func))) {
24215  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24216  return __Pyx_PyObject_CallMethO(func, arg);
24217 #if CYTHON_FAST_PYCCALL
24218  } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
24219  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24220 #endif
24221  }
24222  }
24223  return __Pyx__PyObject_CallOneArg(func, arg);
24224 }
24225 #else
24226 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24227  PyObject *result;
24228  PyObject *args = PyTuple_Pack(1, arg);
24229  if (unlikely(!args)) return NULL;
24230  result = __Pyx_PyObject_Call(func, args, NULL);
24231  Py_DECREF(args);
24232  return result;
24233 }
24234 #endif
24235 
24236 /* PyObjectCallNoArg */
24237 #if CYTHON_COMPILING_IN_CPYTHON
24238 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24239 #if CYTHON_FAST_PYCALL
24240  if (PyFunction_Check(func)) {
24241  return __Pyx_PyFunction_FastCall(func, NULL, 0);
24242  }
24243 #endif
24244 #ifdef __Pyx_CyFunction_USED
24245  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24246 #else
24247  if (likely(PyCFunction_Check(func)))
24248 #endif
24249  {
24250  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24251  return __Pyx_PyObject_CallMethO(func, NULL);
24252  }
24253  }
24254  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24255 }
24256 #endif
24257 
24258 /* DictGetItem */
24259 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24260 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24261  PyObject *value;
24262  value = PyDict_GetItemWithError(d, key);
24263  if (unlikely(!value)) {
24264  if (!PyErr_Occurred()) {
24265  if (unlikely(PyTuple_Check(key))) {
24266  PyObject* args = PyTuple_Pack(1, key);
24267  if (likely(args)) {
24268  PyErr_SetObject(PyExc_KeyError, args);
24269  Py_DECREF(args);
24270  }
24271  } else {
24272  PyErr_SetObject(PyExc_KeyError, key);
24273  }
24274  }
24275  return NULL;
24276  }
24277  Py_INCREF(value);
24278  return value;
24279 }
24280 #endif
24281 
24282 /* RaiseTooManyValuesToUnpack */
24283 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24284  PyErr_Format(PyExc_ValueError,
24285  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
24286 }
24287 
24288 /* RaiseNeedMoreValuesToUnpack */
24289 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24290  PyErr_Format(PyExc_ValueError,
24291  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
24292  index, (index == 1) ? "" : "s");
24293 }
24294 
24295 /* RaiseNoneIterError */
24296 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
24297  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
24298 }
24299 
24300 /* ExtTypeTest */
24301 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
24302  if (unlikely(!type)) {
24303  PyErr_SetString(PyExc_SystemError, "Missing type object");
24304  return 0;
24305  }
24306  if (likely(__Pyx_TypeCheck(obj, type)))
24307  return 1;
24308  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
24309  Py_TYPE(obj)->tp_name, type->tp_name);
24310  return 0;
24311 }
24312 
24313 /* PyErrFetchRestore */
24314 #if CYTHON_FAST_THREAD_STATE
24315 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24316  PyObject *tmp_type, *tmp_value, *tmp_tb;
24317  tmp_type = tstate->curexc_type;
24318  tmp_value = tstate->curexc_value;
24319  tmp_tb = tstate->curexc_traceback;
24320  tstate->curexc_type = type;
24321  tstate->curexc_value = value;
24322  tstate->curexc_traceback = tb;
24323  Py_XDECREF(tmp_type);
24324  Py_XDECREF(tmp_value);
24325  Py_XDECREF(tmp_tb);
24326 }
24327 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24328  *type = tstate->curexc_type;
24329  *value = tstate->curexc_value;
24330  *tb = tstate->curexc_traceback;
24331  tstate->curexc_type = 0;
24332  tstate->curexc_value = 0;
24333  tstate->curexc_traceback = 0;
24334 }
24335 #endif
24336 
24337 /* RaiseException */
24338 #if PY_MAJOR_VERSION < 3
24339 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24340  CYTHON_UNUSED PyObject *cause) {
24341  __Pyx_PyThreadState_declare
24342  Py_XINCREF(type);
24343  if (!value || value == Py_None)
24344  value = NULL;
24345  else
24346  Py_INCREF(value);
24347  if (!tb || tb == Py_None)
24348  tb = NULL;
24349  else {
24350  Py_INCREF(tb);
24351  if (!PyTraceBack_Check(tb)) {
24352  PyErr_SetString(PyExc_TypeError,
24353  "raise: arg 3 must be a traceback or None");
24354  goto raise_error;
24355  }
24356  }
24357  if (PyType_Check(type)) {
24358 #if CYTHON_COMPILING_IN_PYPY
24359  if (!value) {
24360  Py_INCREF(Py_None);
24361  value = Py_None;
24362  }
24363 #endif
24364  PyErr_NormalizeException(&type, &value, &tb);
24365  } else {
24366  if (value) {
24367  PyErr_SetString(PyExc_TypeError,
24368  "instance exception may not have a separate value");
24369  goto raise_error;
24370  }
24371  value = type;
24372  type = (PyObject*) Py_TYPE(type);
24373  Py_INCREF(type);
24374  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24375  PyErr_SetString(PyExc_TypeError,
24376  "raise: exception class must be a subclass of BaseException");
24377  goto raise_error;
24378  }
24379  }
24380  __Pyx_PyThreadState_assign
24381  __Pyx_ErrRestore(type, value, tb);
24382  return;
24383 raise_error:
24384  Py_XDECREF(value);
24385  Py_XDECREF(type);
24386  Py_XDECREF(tb);
24387  return;
24388 }
24389 #else
24390 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24391  PyObject* owned_instance = NULL;
24392  if (tb == Py_None) {
24393  tb = 0;
24394  } else if (tb && !PyTraceBack_Check(tb)) {
24395  PyErr_SetString(PyExc_TypeError,
24396  "raise: arg 3 must be a traceback or None");
24397  goto bad;
24398  }
24399  if (value == Py_None)
24400  value = 0;
24401  if (PyExceptionInstance_Check(type)) {
24402  if (value) {
24403  PyErr_SetString(PyExc_TypeError,
24404  "instance exception may not have a separate value");
24405  goto bad;
24406  }
24407  value = type;
24408  type = (PyObject*) Py_TYPE(value);
24409  } else if (PyExceptionClass_Check(type)) {
24410  PyObject *instance_class = NULL;
24411  if (value && PyExceptionInstance_Check(value)) {
24412  instance_class = (PyObject*) Py_TYPE(value);
24413  if (instance_class != type) {
24414  int is_subclass = PyObject_IsSubclass(instance_class, type);
24415  if (!is_subclass) {
24416  instance_class = NULL;
24417  } else if (unlikely(is_subclass == -1)) {
24418  goto bad;
24419  } else {
24420  type = instance_class;
24421  }
24422  }
24423  }
24424  if (!instance_class) {
24425  PyObject *args;
24426  if (!value)
24427  args = PyTuple_New(0);
24428  else if (PyTuple_Check(value)) {
24429  Py_INCREF(value);
24430  args = value;
24431  } else
24432  args = PyTuple_Pack(1, value);
24433  if (!args)
24434  goto bad;
24435  owned_instance = PyObject_Call(type, args, NULL);
24436  Py_DECREF(args);
24437  if (!owned_instance)
24438  goto bad;
24439  value = owned_instance;
24440  if (!PyExceptionInstance_Check(value)) {
24441  PyErr_Format(PyExc_TypeError,
24442  "calling %R should have returned an instance of "
24443  "BaseException, not %R",
24444  type, Py_TYPE(value));
24445  goto bad;
24446  }
24447  }
24448  } else {
24449  PyErr_SetString(PyExc_TypeError,
24450  "raise: exception class must be a subclass of BaseException");
24451  goto bad;
24452  }
24453  if (cause) {
24454  PyObject *fixed_cause;
24455  if (cause == Py_None) {
24456  fixed_cause = NULL;
24457  } else if (PyExceptionClass_Check(cause)) {
24458  fixed_cause = PyObject_CallObject(cause, NULL);
24459  if (fixed_cause == NULL)
24460  goto bad;
24461  } else if (PyExceptionInstance_Check(cause)) {
24462  fixed_cause = cause;
24463  Py_INCREF(fixed_cause);
24464  } else {
24465  PyErr_SetString(PyExc_TypeError,
24466  "exception causes must derive from "
24467  "BaseException");
24468  goto bad;
24469  }
24470  PyException_SetCause(value, fixed_cause);
24471  }
24472  PyErr_SetObject(type, value);
24473  if (tb) {
24474 #if CYTHON_COMPILING_IN_PYPY
24475  PyObject *tmp_type, *tmp_value, *tmp_tb;
24476  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24477  Py_INCREF(tb);
24478  PyErr_Restore(tmp_type, tmp_value, tb);
24479  Py_XDECREF(tmp_tb);
24480 #else
24481  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24482  PyObject* tmp_tb = tstate->curexc_traceback;
24483  if (tb != tmp_tb) {
24484  Py_INCREF(tb);
24485  tstate->curexc_traceback = tb;
24486  Py_XDECREF(tmp_tb);
24487  }
24488 #endif
24489  }
24490 bad:
24491  Py_XDECREF(owned_instance);
24492  return;
24493 }
24494 #endif
24495 
24496 /* GetTopmostException */
24497 #if CYTHON_USE_EXC_INFO_STACK
24498 static _PyErr_StackItem *
24499 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
24500 {
24501  _PyErr_StackItem *exc_info = tstate->exc_info;
24502  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
24503  exc_info->previous_item != NULL)
24504  {
24505  exc_info = exc_info->previous_item;
24506  }
24507  return exc_info;
24508 }
24509 #endif
24510 
24511 /* SaveResetException */
24512 #if CYTHON_FAST_THREAD_STATE
24513 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24514  #if CYTHON_USE_EXC_INFO_STACK
24515  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
24516  *type = exc_info->exc_type;
24517  *value = exc_info->exc_value;
24518  *tb = exc_info->exc_traceback;
24519  #else
24520  *type = tstate->exc_type;
24521  *value = tstate->exc_value;
24522  *tb = tstate->exc_traceback;
24523  #endif
24524  Py_XINCREF(*type);
24525  Py_XINCREF(*value);
24526  Py_XINCREF(*tb);
24527 }
24528 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24529  PyObject *tmp_type, *tmp_value, *tmp_tb;
24530  #if CYTHON_USE_EXC_INFO_STACK
24531  _PyErr_StackItem *exc_info = tstate->exc_info;
24532  tmp_type = exc_info->exc_type;
24533  tmp_value = exc_info->exc_value;
24534  tmp_tb = exc_info->exc_traceback;
24535  exc_info->exc_type = type;
24536  exc_info->exc_value = value;
24537  exc_info->exc_traceback = tb;
24538  #else
24539  tmp_type = tstate->exc_type;
24540  tmp_value = tstate->exc_value;
24541  tmp_tb = tstate->exc_traceback;
24542  tstate->exc_type = type;
24543  tstate->exc_value = value;
24544  tstate->exc_traceback = tb;
24545  #endif
24546  Py_XDECREF(tmp_type);
24547  Py_XDECREF(tmp_value);
24548  Py_XDECREF(tmp_tb);
24549 }
24550 #endif
24551 
24552 /* PyErrExceptionMatches */
24553 #if CYTHON_FAST_THREAD_STATE
24554 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24555  Py_ssize_t i, n;
24556  n = PyTuple_GET_SIZE(tuple);
24557 #if PY_MAJOR_VERSION >= 3
24558  for (i=0; i<n; i++) {
24559  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24560  }
24561 #endif
24562  for (i=0; i<n; i++) {
24563  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
24564  }
24565  return 0;
24566 }
24567 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24568  PyObject *exc_type = tstate->curexc_type;
24569  if (exc_type == err) return 1;
24570  if (unlikely(!exc_type)) return 0;
24571  if (unlikely(PyTuple_Check(err)))
24572  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24573  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24574 }
24575 #endif
24576 
24577 /* GetException */
24578 #if CYTHON_FAST_THREAD_STATE
24579 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
24580 #else
24581 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
24582 #endif
24583 {
24584  PyObject *local_type, *local_value, *local_tb;
24585 #if CYTHON_FAST_THREAD_STATE
24586  PyObject *tmp_type, *tmp_value, *tmp_tb;
24587  local_type = tstate->curexc_type;
24588  local_value = tstate->curexc_value;
24589  local_tb = tstate->curexc_traceback;
24590  tstate->curexc_type = 0;
24591  tstate->curexc_value = 0;
24592  tstate->curexc_traceback = 0;
24593 #else
24594  PyErr_Fetch(&local_type, &local_value, &local_tb);
24595 #endif
24596  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
24597 #if CYTHON_FAST_THREAD_STATE
24598  if (unlikely(tstate->curexc_type))
24599 #else
24600  if (unlikely(PyErr_Occurred()))
24601 #endif
24602  goto bad;
24603  #if PY_MAJOR_VERSION >= 3
24604  if (local_tb) {
24605  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
24606  goto bad;
24607  }
24608  #endif
24609  Py_XINCREF(local_tb);
24610  Py_XINCREF(local_type);
24611  Py_XINCREF(local_value);
24612  *type = local_type;
24613  *value = local_value;
24614  *tb = local_tb;
24615 #if CYTHON_FAST_THREAD_STATE
24616  #if CYTHON_USE_EXC_INFO_STACK
24617  {
24618  _PyErr_StackItem *exc_info = tstate->exc_info;
24619  tmp_type = exc_info->exc_type;
24620  tmp_value = exc_info->exc_value;
24621  tmp_tb = exc_info->exc_traceback;
24622  exc_info->exc_type = local_type;
24623  exc_info->exc_value = local_value;
24624  exc_info->exc_traceback = local_tb;
24625  }
24626  #else
24627  tmp_type = tstate->exc_type;
24628  tmp_value = tstate->exc_value;
24629  tmp_tb = tstate->exc_traceback;
24630  tstate->exc_type = local_type;
24631  tstate->exc_value = local_value;
24632  tstate->exc_traceback = local_tb;
24633  #endif
24634  Py_XDECREF(tmp_type);
24635  Py_XDECREF(tmp_value);
24636  Py_XDECREF(tmp_tb);
24637 #else
24638  PyErr_SetExcInfo(local_type, local_value, local_tb);
24639 #endif
24640  return 0;
24641 bad:
24642  *type = 0;
24643  *value = 0;
24644  *tb = 0;
24645  Py_XDECREF(local_type);
24646  Py_XDECREF(local_value);
24647  Py_XDECREF(local_tb);
24648  return -1;
24649 }
24650 
24651 /* BytesEquals */
24652 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
24653 #if CYTHON_COMPILING_IN_PYPY
24654  return PyObject_RichCompareBool(s1, s2, equals);
24655 #else
24656  if (s1 == s2) {
24657  return (equals == Py_EQ);
24658  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24659  const char *ps1, *ps2;
24660  Py_ssize_t length = PyBytes_GET_SIZE(s1);
24661  if (length != PyBytes_GET_SIZE(s2))
24662  return (equals == Py_NE);
24663  ps1 = PyBytes_AS_STRING(s1);
24664  ps2 = PyBytes_AS_STRING(s2);
24665  if (ps1[0] != ps2[0]) {
24666  return (equals == Py_NE);
24667  } else if (length == 1) {
24668  return (equals == Py_EQ);
24669  } else {
24670  int result;
24671 #if CYTHON_USE_UNICODE_INTERNALS
24672  Py_hash_t hash1, hash2;
24673  hash1 = ((PyBytesObject*)s1)->ob_shash;
24674  hash2 = ((PyBytesObject*)s2)->ob_shash;
24675  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24676  return (equals == Py_NE);
24677  }
24678 #endif
24679  result = memcmp(ps1, ps2, (size_t)length);
24680  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24681  }
24682  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
24683  return (equals == Py_NE);
24684  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
24685  return (equals == Py_NE);
24686  } else {
24687  int result;
24688  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24689  if (!py_result)
24690  return -1;
24691  result = __Pyx_PyObject_IsTrue(py_result);
24692  Py_DECREF(py_result);
24693  return result;
24694  }
24695 #endif
24696 }
24697 
24698 /* UnicodeEquals */
24699 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
24700 #if CYTHON_COMPILING_IN_PYPY
24701  return PyObject_RichCompareBool(s1, s2, equals);
24702 #else
24703 #if PY_MAJOR_VERSION < 3
24704  PyObject* owned_ref = NULL;
24705 #endif
24706  int s1_is_unicode, s2_is_unicode;
24707  if (s1 == s2) {
24708  goto return_eq;
24709  }
24710  s1_is_unicode = PyUnicode_CheckExact(s1);
24711  s2_is_unicode = PyUnicode_CheckExact(s2);
24712 #if PY_MAJOR_VERSION < 3
24713  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
24714  owned_ref = PyUnicode_FromObject(s2);
24715  if (unlikely(!owned_ref))
24716  return -1;
24717  s2 = owned_ref;
24718  s2_is_unicode = 1;
24719  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
24720  owned_ref = PyUnicode_FromObject(s1);
24721  if (unlikely(!owned_ref))
24722  return -1;
24723  s1 = owned_ref;
24724  s1_is_unicode = 1;
24725  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
24726  return __Pyx_PyBytes_Equals(s1, s2, equals);
24727  }
24728 #endif
24729  if (s1_is_unicode & s2_is_unicode) {
24730  Py_ssize_t length;
24731  int kind;
24732  void *data1, *data2;
24733  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
24734  return -1;
24735  length = __Pyx_PyUnicode_GET_LENGTH(s1);
24736  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
24737  goto return_ne;
24738  }
24739 #if CYTHON_USE_UNICODE_INTERNALS
24740  {
24741  Py_hash_t hash1, hash2;
24742  #if CYTHON_PEP393_ENABLED
24743  hash1 = ((PyASCIIObject*)s1)->hash;
24744  hash2 = ((PyASCIIObject*)s2)->hash;
24745  #else
24746  hash1 = ((PyUnicodeObject*)s1)->hash;
24747  hash2 = ((PyUnicodeObject*)s2)->hash;
24748  #endif
24749  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24750  goto return_ne;
24751  }
24752  }
24753 #endif
24754  kind = __Pyx_PyUnicode_KIND(s1);
24755  if (kind != __Pyx_PyUnicode_KIND(s2)) {
24756  goto return_ne;
24757  }
24758  data1 = __Pyx_PyUnicode_DATA(s1);
24759  data2 = __Pyx_PyUnicode_DATA(s2);
24760  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
24761  goto return_ne;
24762  } else if (length == 1) {
24763  goto return_eq;
24764  } else {
24765  int result = memcmp(data1, data2, (size_t)(length * kind));
24766  #if PY_MAJOR_VERSION < 3
24767  Py_XDECREF(owned_ref);
24768  #endif
24769  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24770  }
24771  } else if ((s1 == Py_None) & s2_is_unicode) {
24772  goto return_ne;
24773  } else if ((s2 == Py_None) & s1_is_unicode) {
24774  goto return_ne;
24775  } else {
24776  int result;
24777  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24778  #if PY_MAJOR_VERSION < 3
24779  Py_XDECREF(owned_ref);
24780  #endif
24781  if (!py_result)
24782  return -1;
24783  result = __Pyx_PyObject_IsTrue(py_result);
24784  Py_DECREF(py_result);
24785  return result;
24786  }
24787 return_eq:
24788  #if PY_MAJOR_VERSION < 3
24789  Py_XDECREF(owned_ref);
24790  #endif
24791  return (equals == Py_EQ);
24792 return_ne:
24793  #if PY_MAJOR_VERSION < 3
24794  Py_XDECREF(owned_ref);
24795  #endif
24796  return (equals == Py_NE);
24797 #endif
24798 }
24799 
24800 /* None */
24801 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
24802  Py_ssize_t q = a / b;
24803  Py_ssize_t r = a - q*b;
24804  q -= ((r != 0) & ((r ^ b) < 0));
24805  return q;
24806 }
24807 
24808 /* GetAttr */
24809 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
24810 #if CYTHON_USE_TYPE_SLOTS
24811 #if PY_MAJOR_VERSION >= 3
24812  if (likely(PyUnicode_Check(n)))
24813 #else
24814  if (likely(PyString_Check(n)))
24815 #endif
24816  return __Pyx_PyObject_GetAttrStr(o, n);
24817 #endif
24818  return PyObject_GetAttr(o, n);
24819 }
24820 
24821 /* GetItemInt */
24822 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24823  PyObject *r;
24824  if (!j) return NULL;
24825  r = PyObject_GetItem(o, j);
24826  Py_DECREF(j);
24827  return r;
24828 }
24829 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24830  CYTHON_NCP_UNUSED int wraparound,
24831  CYTHON_NCP_UNUSED int boundscheck) {
24832 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24833  Py_ssize_t wrapped_i = i;
24834  if (wraparound & unlikely(i < 0)) {
24835  wrapped_i += PyList_GET_SIZE(o);
24836  }
24837  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24838  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24839  Py_INCREF(r);
24840  return r;
24841  }
24842  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24843 #else
24844  return PySequence_GetItem(o, i);
24845 #endif
24846 }
24847 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24848  CYTHON_NCP_UNUSED int wraparound,
24849  CYTHON_NCP_UNUSED int boundscheck) {
24850 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24851  Py_ssize_t wrapped_i = i;
24852  if (wraparound & unlikely(i < 0)) {
24853  wrapped_i += PyTuple_GET_SIZE(o);
24854  }
24855  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24856  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24857  Py_INCREF(r);
24858  return r;
24859  }
24860  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24861 #else
24862  return PySequence_GetItem(o, i);
24863 #endif
24864 }
24865 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
24866  CYTHON_NCP_UNUSED int wraparound,
24867  CYTHON_NCP_UNUSED int boundscheck) {
24868 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24869  if (is_list || PyList_CheckExact(o)) {
24870  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24871  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
24872  PyObject *r = PyList_GET_ITEM(o, n);
24873  Py_INCREF(r);
24874  return r;
24875  }
24876  }
24877  else if (PyTuple_CheckExact(o)) {
24878  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24879  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
24880  PyObject *r = PyTuple_GET_ITEM(o, n);
24881  Py_INCREF(r);
24882  return r;
24883  }
24884  } else {
24885  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24886  if (likely(m && m->sq_item)) {
24887  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24888  Py_ssize_t l = m->sq_length(o);
24889  if (likely(l >= 0)) {
24890  i += l;
24891  } else {
24892  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24893  return NULL;
24894  PyErr_Clear();
24895  }
24896  }
24897  return m->sq_item(o, i);
24898  }
24899  }
24900 #else
24901  if (is_list || PySequence_Check(o)) {
24902  return PySequence_GetItem(o, i);
24903  }
24904 #endif
24905  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24906 }
24907 
24908 /* ObjectGetItem */
24909 #if CYTHON_USE_TYPE_SLOTS
24910 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24911  PyObject *runerr;
24912  Py_ssize_t key_value;
24913  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24914  if (unlikely(!(m && m->sq_item))) {
24915  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24916  return NULL;
24917  }
24918  key_value = __Pyx_PyIndex_AsSsize_t(index);
24919  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24920  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24921  }
24922  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24923  PyErr_Clear();
24924  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24925  }
24926  return NULL;
24927 }
24928 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24929  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24930  if (likely(m && m->mp_subscript)) {
24931  return m->mp_subscript(obj, key);
24932  }
24933  return __Pyx_PyObject_GetIndex(obj, key);
24934 }
24935 #endif
24936 
24937 /* decode_c_string */
24938 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
24939  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
24940  const char* encoding, const char* errors,
24941  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
24942  Py_ssize_t length;
24943  if (unlikely((start < 0) | (stop < 0))) {
24944  size_t slen = strlen(cstring);
24945  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
24946  PyErr_SetString(PyExc_OverflowError,
24947  "c-string too long to convert to Python");
24948  return NULL;
24949  }
24950  length = (Py_ssize_t) slen;
24951  if (start < 0) {
24952  start += length;
24953  if (start < 0)
24954  start = 0;
24955  }
24956  if (stop < 0)
24957  stop += length;
24958  }
24959  if (unlikely(stop <= start))
24960  return __Pyx_NewRef(__pyx_empty_unicode);
24961  length = stop - start;
24962  cstring += start;
24963  if (decode_func) {
24964  return decode_func(cstring, length, errors);
24965  } else {
24966  return PyUnicode_Decode(cstring, length, encoding, errors);
24967  }
24968 }
24969 
24970 /* GetAttr3 */
24971 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24972  __Pyx_PyThreadState_declare
24973  __Pyx_PyThreadState_assign
24974  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24975  return NULL;
24976  __Pyx_PyErr_Clear();
24977  Py_INCREF(d);
24978  return d;
24979 }
24980 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
24981  PyObject *r = __Pyx_GetAttr(o, n);
24982  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
24983 }
24984 
24985 /* SwapException */
24986 #if CYTHON_FAST_THREAD_STATE
24987 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24988  PyObject *tmp_type, *tmp_value, *tmp_tb;
24989  #if CYTHON_USE_EXC_INFO_STACK
24990  _PyErr_StackItem *exc_info = tstate->exc_info;
24991  tmp_type = exc_info->exc_type;
24992  tmp_value = exc_info->exc_value;
24993  tmp_tb = exc_info->exc_traceback;
24994  exc_info->exc_type = *type;
24995  exc_info->exc_value = *value;
24996  exc_info->exc_traceback = *tb;
24997  #else
24998  tmp_type = tstate->exc_type;
24999  tmp_value = tstate->exc_value;
25000  tmp_tb = tstate->exc_traceback;
25001  tstate->exc_type = *type;
25002  tstate->exc_value = *value;
25003  tstate->exc_traceback = *tb;
25004  #endif
25005  *type = tmp_type;
25006  *value = tmp_value;
25007  *tb = tmp_tb;
25008 }
25009 #else
25010 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25011  PyObject *tmp_type, *tmp_value, *tmp_tb;
25012  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25013  PyErr_SetExcInfo(*type, *value, *tb);
25014  *type = tmp_type;
25015  *value = tmp_value;
25016  *tb = tmp_tb;
25017 }
25018 #endif
25019 
25020 /* Import */
25021 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
25022  PyObject *empty_list = 0;
25023  PyObject *module = 0;
25024  PyObject *global_dict = 0;
25025  PyObject *empty_dict = 0;
25026  PyObject *list;
25027  #if PY_MAJOR_VERSION < 3
25028  PyObject *py_import;
25029  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25030  if (!py_import)
25031  goto bad;
25032  #endif
25033  if (from_list)
25034  list = from_list;
25035  else {
25036  empty_list = PyList_New(0);
25037  if (!empty_list)
25038  goto bad;
25039  list = empty_list;
25040  }
25041  global_dict = PyModule_GetDict(__pyx_m);
25042  if (!global_dict)
25043  goto bad;
25044  empty_dict = PyDict_New();
25045  if (!empty_dict)
25046  goto bad;
25047  {
25048  #if PY_MAJOR_VERSION >= 3
25049  if (level == -1) {
25050  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
25051  module = PyImport_ImportModuleLevelObject(
25052  name, global_dict, empty_dict, list, 1);
25053  if (!module) {
25054  if (!PyErr_ExceptionMatches(PyExc_ImportError))
25055  goto bad;
25056  PyErr_Clear();
25057  }
25058  }
25059  level = 0;
25060  }
25061  #endif
25062  if (!module) {
25063  #if PY_MAJOR_VERSION < 3
25064  PyObject *py_level = PyInt_FromLong(level);
25065  if (!py_level)
25066  goto bad;
25067  module = PyObject_CallFunctionObjArgs(py_import,
25068  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25069  Py_DECREF(py_level);
25070  #else
25071  module = PyImport_ImportModuleLevelObject(
25072  name, global_dict, empty_dict, list, level);
25073  #endif
25074  }
25075  }
25076 bad:
25077  #if PY_MAJOR_VERSION < 3
25078  Py_XDECREF(py_import);
25079  #endif
25080  Py_XDECREF(empty_list);
25081  Py_XDECREF(empty_dict);
25082  return module;
25083 }
25084 
25085 /* FastTypeChecks */
25086 #if CYTHON_COMPILING_IN_CPYTHON
25087 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25088  while (a) {
25089  a = a->tp_base;
25090  if (a == b)
25091  return 1;
25092  }
25093  return b == &PyBaseObject_Type;
25094 }
25095 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25096  PyObject *mro;
25097  if (a == b) return 1;
25098  mro = a->tp_mro;
25099  if (likely(mro)) {
25100  Py_ssize_t i, n;
25101  n = PyTuple_GET_SIZE(mro);
25102  for (i = 0; i < n; i++) {
25103  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25104  return 1;
25105  }
25106  return 0;
25107  }
25108  return __Pyx_InBases(a, b);
25109 }
25110 #if PY_MAJOR_VERSION == 2
25111 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25112  PyObject *exception, *value, *tb;
25113  int res;
25114  __Pyx_PyThreadState_declare
25115  __Pyx_PyThreadState_assign
25116  __Pyx_ErrFetch(&exception, &value, &tb);
25117  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25118  if (unlikely(res == -1)) {
25119  PyErr_WriteUnraisable(err);
25120  res = 0;
25121  }
25122  if (!res) {
25123  res = PyObject_IsSubclass(err, exc_type2);
25124  if (unlikely(res == -1)) {
25125  PyErr_WriteUnraisable(err);
25126  res = 0;
25127  }
25128  }
25129  __Pyx_ErrRestore(exception, value, tb);
25130  return res;
25131 }
25132 #else
25133 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25134  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25135  if (!res) {
25136  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25137  }
25138  return res;
25139 }
25140 #endif
25141 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25142  Py_ssize_t i, n;
25143  assert(PyExceptionClass_Check(exc_type));
25144  n = PyTuple_GET_SIZE(tuple);
25145 #if PY_MAJOR_VERSION >= 3
25146  for (i=0; i<n; i++) {
25147  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25148  }
25149 #endif
25150  for (i=0; i<n; i++) {
25151  PyObject *t = PyTuple_GET_ITEM(tuple, i);
25152  #if PY_MAJOR_VERSION < 3
25153  if (likely(exc_type == t)) return 1;
25154  #endif
25155  if (likely(PyExceptionClass_Check(t))) {
25156  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
25157  } else {
25158  }
25159  }
25160  return 0;
25161 }
25162 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25163  if (likely(err == exc_type)) return 1;
25164  if (likely(PyExceptionClass_Check(err))) {
25165  if (likely(PyExceptionClass_Check(exc_type))) {
25166  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25167  } else if (likely(PyTuple_Check(exc_type))) {
25168  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25169  } else {
25170  }
25171  }
25172  return PyErr_GivenExceptionMatches(err, exc_type);
25173 }
25174 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25175  assert(PyExceptionClass_Check(exc_type1));
25176  assert(PyExceptionClass_Check(exc_type2));
25177  if (likely(err == exc_type1 || err == exc_type2)) return 1;
25178  if (likely(PyExceptionClass_Check(err))) {
25179  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25180  }
25181  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25182 }
25183 #endif
25184 
25185 /* None */
25186 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
25187  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
25188 }
25189 
25190 /* None */
25191 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
25192  long q = a / b;
25193  long r = a - q*b;
25194  q -= ((r != 0) & ((r ^ b) < 0));
25195  return q;
25196 }
25197 
25198 /* ImportFrom */
25199 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25200  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25201  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25202  PyErr_Format(PyExc_ImportError,
25203  #if PY_MAJOR_VERSION < 3
25204  "cannot import name %.230s", PyString_AS_STRING(name));
25205  #else
25206  "cannot import name %S", name);
25207  #endif
25208  }
25209  return value;
25210 }
25211 
25212 /* HasAttr */
25213 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25214  PyObject *r;
25215  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25216  PyErr_SetString(PyExc_TypeError,
25217  "hasattr(): attribute name must be string");
25218  return -1;
25219  }
25220  r = __Pyx_GetAttr(o, n);
25221  if (unlikely(!r)) {
25222  PyErr_Clear();
25223  return 0;
25224  } else {
25225  Py_DECREF(r);
25226  return 1;
25227  }
25228 }
25229 
25230 /* StringJoin */
25231 #if !CYTHON_COMPILING_IN_CPYTHON
25232 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
25233  return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
25234 }
25235 #endif
25236 
25237 /* PyObject_GenericGetAttrNoDict */
25238 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25239 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25240  PyErr_Format(PyExc_AttributeError,
25241 #if PY_MAJOR_VERSION >= 3
25242  "'%.50s' object has no attribute '%U'",
25243  tp->tp_name, attr_name);
25244 #else
25245  "'%.50s' object has no attribute '%.400s'",
25246  tp->tp_name, PyString_AS_STRING(attr_name));
25247 #endif
25248  return NULL;
25249 }
25250 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25251  PyObject *descr;
25252  PyTypeObject *tp = Py_TYPE(obj);
25253  if (unlikely(!PyString_Check(attr_name))) {
25254  return PyObject_GenericGetAttr(obj, attr_name);
25255  }
25256  assert(!tp->tp_dictoffset);
25257  descr = _PyType_Lookup(tp, attr_name);
25258  if (unlikely(!descr)) {
25259  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25260  }
25261  Py_INCREF(descr);
25262  #if PY_MAJOR_VERSION < 3
25263  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25264  #endif
25265  {
25266  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25267  if (unlikely(f)) {
25268  PyObject *res = f(descr, obj, (PyObject *)tp);
25269  Py_DECREF(descr);
25270  return res;
25271  }
25272  }
25273  return descr;
25274 }
25275 #endif
25276 
25277 /* PyObject_GenericGetAttr */
25278 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25279 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25280  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25281  return PyObject_GenericGetAttr(obj, attr_name);
25282  }
25283  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25284 }
25285 #endif
25286 
25287 /* SetVTable */
25288 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
25289 #if PY_VERSION_HEX >= 0x02070000
25290  PyObject *ob = PyCapsule_New(vtable, 0, 0);
25291 #else
25292  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25293 #endif
25294  if (!ob)
25295  goto bad;
25296  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25297  goto bad;
25298  Py_DECREF(ob);
25299  return 0;
25300 bad:
25301  Py_XDECREF(ob);
25302  return -1;
25303 }
25304 
25305 /* PyObjectGetAttrStrNoError */
25306 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
25307  __Pyx_PyThreadState_declare
25308  __Pyx_PyThreadState_assign
25309  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25310  __Pyx_PyErr_Clear();
25311 }
25312 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
25313  PyObject *result;
25314 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
25315  PyTypeObject* tp = Py_TYPE(obj);
25316  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
25317  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
25318  }
25319 #endif
25320  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
25321  if (unlikely(!result)) {
25322  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
25323  }
25324  return result;
25325 }
25326 
25327 /* SetupReduce */
25328 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25329  int ret;
25330  PyObject *name_attr;
25331  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25332  if (likely(name_attr)) {
25333  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25334  } else {
25335  ret = -1;
25336  }
25337  if (unlikely(ret < 0)) {
25338  PyErr_Clear();
25339  ret = 0;
25340  }
25341  Py_XDECREF(name_attr);
25342  return ret;
25343 }
25344 static int __Pyx_setup_reduce(PyObject* type_obj) {
25345  int ret = 0;
25346  PyObject *object_reduce = NULL;
25347  PyObject *object_reduce_ex = NULL;
25348  PyObject *reduce = NULL;
25349  PyObject *reduce_ex = NULL;
25350  PyObject *reduce_cython = NULL;
25351  PyObject *setstate = NULL;
25352  PyObject *setstate_cython = NULL;
25353 #if CYTHON_USE_PYTYPE_LOOKUP
25354  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
25355 #else
25356  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
25357 #endif
25358 #if CYTHON_USE_PYTYPE_LOOKUP
25359  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25360 #else
25361  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25362 #endif
25363  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
25364  if (reduce_ex == object_reduce_ex) {
25365 #if CYTHON_USE_PYTYPE_LOOKUP
25366  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25367 #else
25368  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25369 #endif
25370  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
25371  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25372  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
25373  if (likely(reduce_cython)) {
25374  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25375  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25376  } else if (reduce == object_reduce || PyErr_Occurred()) {
25377  goto __PYX_BAD;
25378  }
25379  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25380  if (!setstate) PyErr_Clear();
25381  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25382  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
25383  if (likely(setstate_cython)) {
25384  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25385  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25386  } else if (!setstate || PyErr_Occurred()) {
25387  goto __PYX_BAD;
25388  }
25389  }
25390  PyType_Modified((PyTypeObject*)type_obj);
25391  }
25392  }
25393  goto __PYX_GOOD;
25394 __PYX_BAD:
25395  if (!PyErr_Occurred())
25396  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25397  ret = -1;
25398 __PYX_GOOD:
25399 #if !CYTHON_USE_PYTYPE_LOOKUP
25400  Py_XDECREF(object_reduce);
25401  Py_XDECREF(object_reduce_ex);
25402 #endif
25403  Py_XDECREF(reduce);
25404  Py_XDECREF(reduce_ex);
25405  Py_XDECREF(reduce_cython);
25406  Py_XDECREF(setstate);
25407  Py_XDECREF(setstate_cython);
25408  return ret;
25409 }
25410 
25411 /* TypeImport */
25412 #ifndef __PYX_HAVE_RT_ImportType
25413 #define __PYX_HAVE_RT_ImportType
25414 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
25415  size_t size, enum __Pyx_ImportType_CheckSize check_size)
25416 {
25417  PyObject *result = 0;
25418  char warning[200];
25419  Py_ssize_t basicsize;
25420 #ifdef Py_LIMITED_API
25421  PyObject *py_basicsize;
25422 #endif
25423  result = PyObject_GetAttrString(module, class_name);
25424  if (!result)
25425  goto bad;
25426  if (!PyType_Check(result)) {
25427  PyErr_Format(PyExc_TypeError,
25428  "%.200s.%.200s is not a type object",
25429  module_name, class_name);
25430  goto bad;
25431  }
25432 #ifndef Py_LIMITED_API
25433  basicsize = ((PyTypeObject *)result)->tp_basicsize;
25434 #else
25435  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
25436  if (!py_basicsize)
25437  goto bad;
25438  basicsize = PyLong_AsSsize_t(py_basicsize);
25439  Py_DECREF(py_basicsize);
25440  py_basicsize = 0;
25441  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25442  goto bad;
25443 #endif
25444  if ((size_t)basicsize < size) {
25445  PyErr_Format(PyExc_ValueError,
25446  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25447  "Expected %zd from C header, got %zd from PyObject",
25448  module_name, class_name, size, basicsize);
25449  goto bad;
25450  }
25451  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
25452  PyErr_Format(PyExc_ValueError,
25453  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25454  "Expected %zd from C header, got %zd from PyObject",
25455  module_name, class_name, size, basicsize);
25456  goto bad;
25457  }
25458  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
25459  PyOS_snprintf(warning, sizeof(warning),
25460  "%s.%s size changed, may indicate binary incompatibility. "
25461  "Expected %zd from C header, got %zd from PyObject",
25462  module_name, class_name, size, basicsize);
25463  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
25464  }
25465  return (PyTypeObject *)result;
25466 bad:
25467  Py_XDECREF(result);
25468  return NULL;
25469 }
25470 #endif
25471 
25472 /* CLineInTraceback */
25473 #ifndef CYTHON_CLINE_IN_TRACEBACK
25474 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
25475  PyObject *use_cline;
25476  PyObject *ptype, *pvalue, *ptraceback;
25477 #if CYTHON_COMPILING_IN_CPYTHON
25478  PyObject **cython_runtime_dict;
25479 #endif
25480  if (unlikely(!__pyx_cython_runtime)) {
25481  return c_line;
25482  }
25483  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25484 #if CYTHON_COMPILING_IN_CPYTHON
25485  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25486  if (likely(cython_runtime_dict)) {
25487  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
25488  use_cline, *cython_runtime_dict,
25489  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
25490  } else
25491 #endif
25492  {
25493  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25494  if (use_cline_obj) {
25495  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25496  Py_DECREF(use_cline_obj);
25497  } else {
25498  PyErr_Clear();
25499  use_cline = NULL;
25500  }
25501  }
25502  if (!use_cline) {
25503  c_line = 0;
25504  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25505  }
25506  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
25507  c_line = 0;
25508  }
25509  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25510  return c_line;
25511 }
25512 #endif
25513 
25514 /* CodeObjectCache */
25515 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
25516  int start = 0, mid = 0, end = count - 1;
25517  if (end >= 0 && code_line > entries[end].code_line) {
25518  return count;
25519  }
25520  while (start < end) {
25521  mid = start + (end - start) / 2;
25522  if (code_line < entries[mid].code_line) {
25523  end = mid;
25524  } else if (code_line > entries[mid].code_line) {
25525  start = mid + 1;
25526  } else {
25527  return mid;
25528  }
25529  }
25530  if (code_line <= entries[mid].code_line) {
25531  return mid;
25532  } else {
25533  return mid + 1;
25534  }
25535 }
25536 static PyCodeObject *__pyx_find_code_object(int code_line) {
25537  PyCodeObject* code_object;
25538  int pos;
25539  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25540  return NULL;
25541  }
25542  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25543  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
25544  return NULL;
25545  }
25546  code_object = __pyx_code_cache.entries[pos].code_object;
25547  Py_INCREF(code_object);
25548  return code_object;
25549 }
25550 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
25551  int pos, i;
25552  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25553  if (unlikely(!code_line)) {
25554  return;
25555  }
25556  if (unlikely(!entries)) {
25557  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
25558  if (likely(entries)) {
25559  __pyx_code_cache.entries = entries;
25560  __pyx_code_cache.max_count = 64;
25561  __pyx_code_cache.count = 1;
25562  entries[0].code_line = code_line;
25563  entries[0].code_object = code_object;
25564  Py_INCREF(code_object);
25565  }
25566  return;
25567  }
25568  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25569  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
25570  PyCodeObject* tmp = entries[pos].code_object;
25571  entries[pos].code_object = code_object;
25572  Py_DECREF(tmp);
25573  return;
25574  }
25575  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
25576  int new_max = __pyx_code_cache.max_count + 64;
25577  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
25578  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
25579  if (unlikely(!entries)) {
25580  return;
25581  }
25582  __pyx_code_cache.entries = entries;
25583  __pyx_code_cache.max_count = new_max;
25584  }
25585  for (i=__pyx_code_cache.count; i>pos; i--) {
25586  entries[i] = entries[i-1];
25587  }
25588  entries[pos].code_line = code_line;
25589  entries[pos].code_object = code_object;
25590  __pyx_code_cache.count++;
25591  Py_INCREF(code_object);
25592 }
25593 
25594 /* AddTraceback */
25595 #include "compile.h"
25596 #include "frameobject.h"
25597 #include "traceback.h"
25598 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
25599  const char *funcname, int c_line,
25600  int py_line, const char *filename) {
25601  PyCodeObject *py_code = 0;
25602  PyObject *py_srcfile = 0;
25603  PyObject *py_funcname = 0;
25604  #if PY_MAJOR_VERSION < 3
25605  py_srcfile = PyString_FromString(filename);
25606  #else
25607  py_srcfile = PyUnicode_FromString(filename);
25608  #endif
25609  if (!py_srcfile) goto bad;
25610  if (c_line) {
25611  #if PY_MAJOR_VERSION < 3
25612  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25613  #else
25614  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25615  #endif
25616  }
25617  else {
25618  #if PY_MAJOR_VERSION < 3
25619  py_funcname = PyString_FromString(funcname);
25620  #else
25621  py_funcname = PyUnicode_FromString(funcname);
25622  #endif
25623  }
25624  if (!py_funcname) goto bad;
25625  py_code = __Pyx_PyCode_New(
25626  0,
25627  0,
25628  0,
25629  0,
25630  0,
25631  __pyx_empty_bytes, /*PyObject *code,*/
25632  __pyx_empty_tuple, /*PyObject *consts,*/
25633  __pyx_empty_tuple, /*PyObject *names,*/
25634  __pyx_empty_tuple, /*PyObject *varnames,*/
25635  __pyx_empty_tuple, /*PyObject *freevars,*/
25636  __pyx_empty_tuple, /*PyObject *cellvars,*/
25637  py_srcfile, /*PyObject *filename,*/
25638  py_funcname, /*PyObject *name,*/
25639  py_line,
25640  __pyx_empty_bytes /*PyObject *lnotab*/
25641  );
25642  Py_DECREF(py_srcfile);
25643  Py_DECREF(py_funcname);
25644  return py_code;
25645 bad:
25646  Py_XDECREF(py_srcfile);
25647  Py_XDECREF(py_funcname);
25648  return NULL;
25649 }
25650 static void __Pyx_AddTraceback(const char *funcname, int c_line,
25651  int py_line, const char *filename) {
25652  PyCodeObject *py_code = 0;
25653  PyFrameObject *py_frame = 0;
25654  PyThreadState *tstate = __Pyx_PyThreadState_Current;
25655  if (c_line) {
25656  c_line = __Pyx_CLineForTraceback(tstate, c_line);
25657  }
25658  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
25659  if (!py_code) {
25660  py_code = __Pyx_CreateCodeObjectForTraceback(
25661  funcname, c_line, py_line, filename);
25662  if (!py_code) goto bad;
25663  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
25664  }
25665  py_frame = PyFrame_New(
25666  tstate, /*PyThreadState *tstate,*/
25667  py_code, /*PyCodeObject *code,*/
25668  __pyx_d, /*PyObject *globals,*/
25669  0 /*PyObject *locals*/
25670  );
25671  if (!py_frame) goto bad;
25672  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
25673  PyTraceBack_Here(py_frame);
25674 bad:
25675  Py_XDECREF(py_code);
25676  Py_XDECREF(py_frame);
25677 }
25678 
25679 /* CIntFromPyVerify */
25680 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
25681  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
25682 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
25683  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
25684 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
25685  {\
25686  func_type value = func_value;\
25687  if (sizeof(target_type) < sizeof(func_type)) {\
25688  if (unlikely(value != (func_type) (target_type) value)) {\
25689  func_type zero = 0;\
25690  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
25691  return (target_type) -1;\
25692  if (is_unsigned && unlikely(value < zero))\
25693  goto raise_neg_overflow;\
25694  else\
25695  goto raise_overflow;\
25696  }\
25697  }\
25698  return (target_type) value;\
25699  }
25700 
25701 /* CIntToPy */
25702 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
25703  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
25704  const int is_unsigned = neg_one > const_zero;
25705  if (is_unsigned) {
25706  if (sizeof(int) < sizeof(long)) {
25707  return PyInt_FromLong((long) value);
25708  } else if (sizeof(int) <= sizeof(unsigned long)) {
25709  return PyLong_FromUnsignedLong((unsigned long) value);
25710 #ifdef HAVE_LONG_LONG
25711  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
25712  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
25713 #endif
25714  }
25715  } else {
25716  if (sizeof(int) <= sizeof(long)) {
25717  return PyInt_FromLong((long) value);
25718 #ifdef HAVE_LONG_LONG
25719  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
25720  return PyLong_FromLongLong((PY_LONG_LONG) value);
25721 #endif
25722  }
25723  }
25724  {
25725  int one = 1; int little = (int)*(unsigned char *)&one;
25726  unsigned char *bytes = (unsigned char *)&value;
25727  return _PyLong_FromByteArray(bytes, sizeof(int),
25728  little, !is_unsigned);
25729  }
25730 }
25731 
25732 /* MemviewDtypeToObject */
25733 static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp) {
25734  return (PyObject *) __Pyx_PyInt_From_int(*(int *) itemp);
25735 }
25736 static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj) {
25737  int value = __Pyx_PyInt_As_int(obj);
25738  if ((value == (int)-1) && PyErr_Occurred())
25739  return 0;
25740  *(int *) itemp = value;
25741  return 1;
25742 }
25743 
25744 /* Declarations */
25745 #if CYTHON_CCOMPLEX
25746  #ifdef __cplusplus
25747  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
25748  return ::std::complex< float >(x, y);
25749  }
25750  #else
25751  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
25752  return x + y*(__pyx_t_float_complex)_Complex_I;
25753  }
25754  #endif
25755 #else
25756  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
25757  __pyx_t_float_complex z;
25758  z.real = x;
25759  z.imag = y;
25760  return z;
25761  }
25762 #endif
25763 
25764 /* Arithmetic */
25765 #if CYTHON_CCOMPLEX
25766 #else
25767  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25768  return (a.real == b.real) && (a.imag == b.imag);
25769  }
25770  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25771  __pyx_t_float_complex z;
25772  z.real = a.real + b.real;
25773  z.imag = a.imag + b.imag;
25774  return z;
25775  }
25776  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25777  __pyx_t_float_complex z;
25778  z.real = a.real - b.real;
25779  z.imag = a.imag - b.imag;
25780  return z;
25781  }
25782  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25783  __pyx_t_float_complex z;
25784  z.real = a.real * b.real - a.imag * b.imag;
25785  z.imag = a.real * b.imag + a.imag * b.real;
25786  return z;
25787  }
25788  #if 1
25789  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25790  if (b.imag == 0) {
25791  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
25792  } else if (fabsf(b.real) >= fabsf(b.imag)) {
25793  if (b.real == 0 && b.imag == 0) {
25794  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
25795  } else {
25796  float r = b.imag / b.real;
25797  float s = (float)(1.0) / (b.real + b.imag * r);
25798  return __pyx_t_float_complex_from_parts(
25799  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
25800  }
25801  } else {
25802  float r = b.real / b.imag;
25803  float s = (float)(1.0) / (b.imag + b.real * r);
25804  return __pyx_t_float_complex_from_parts(
25805  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
25806  }
25807  }
25808  #else
25809  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25810  if (b.imag == 0) {
25811  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
25812  } else {
25813  float denom = b.real * b.real + b.imag * b.imag;
25814  return __pyx_t_float_complex_from_parts(
25815  (a.real * b.real + a.imag * b.imag) / denom,
25816  (a.imag * b.real - a.real * b.imag) / denom);
25817  }
25818  }
25819  #endif
25820  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
25821  __pyx_t_float_complex z;
25822  z.real = -a.real;
25823  z.imag = -a.imag;
25824  return z;
25825  }
25826  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
25827  return (a.real == 0) && (a.imag == 0);
25828  }
25829  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
25830  __pyx_t_float_complex z;
25831  z.real = a.real;
25832  z.imag = -a.imag;
25833  return z;
25834  }
25835  #if 1
25836  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
25837  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
25838  return sqrtf(z.real*z.real + z.imag*z.imag);
25839  #else
25840  return hypotf(z.real, z.imag);
25841  #endif
25842  }
25843  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25844  __pyx_t_float_complex z;
25845  float r, lnr, theta, z_r, z_theta;
25846  if (b.imag == 0 && b.real == (int)b.real) {
25847  if (b.real < 0) {
25848  float denom = a.real * a.real + a.imag * a.imag;
25849  a.real = a.real / denom;
25850  a.imag = -a.imag / denom;
25851  b.real = -b.real;
25852  }
25853  switch ((int)b.real) {
25854  case 0:
25855  z.real = 1;
25856  z.imag = 0;
25857  return z;
25858  case 1:
25859  return a;
25860  case 2:
25861  return __Pyx_c_prod_float(a, a);
25862  case 3:
25863  z = __Pyx_c_prod_float(a, a);
25864  return __Pyx_c_prod_float(z, a);
25865  case 4:
25866  z = __Pyx_c_prod_float(a, a);
25867  return __Pyx_c_prod_float(z, z);
25868  }
25869  }
25870  if (a.imag == 0) {
25871  if (a.real == 0) {
25872  return a;
25873  } else if (b.imag == 0) {
25874  z.real = powf(a.real, b.real);
25875  z.imag = 0;
25876  return z;
25877  } else if (a.real > 0) {
25878  r = a.real;
25879  theta = 0;
25880  } else {
25881  r = -a.real;
25882  theta = atan2f(0.0, -1.0);
25883  }
25884  } else {
25885  r = __Pyx_c_abs_float(a);
25886  theta = atan2f(a.imag, a.real);
25887  }
25888  lnr = logf(r);
25889  z_r = expf(lnr * b.real - theta * b.imag);
25890  z_theta = theta * b.real + lnr * b.imag;
25891  z.real = z_r * cosf(z_theta);
25892  z.imag = z_r * sinf(z_theta);
25893  return z;
25894  }
25895  #endif
25896 #endif
25897 
25898 /* Declarations */
25899 #if CYTHON_CCOMPLEX
25900  #ifdef __cplusplus
25901  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
25902  return ::std::complex< double >(x, y);
25903  }
25904  #else
25905  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
25906  return x + y*(__pyx_t_double_complex)_Complex_I;
25907  }
25908  #endif
25909 #else
25910  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
25911  __pyx_t_double_complex z;
25912  z.real = x;
25913  z.imag = y;
25914  return z;
25915  }
25916 #endif
25917 
25918 /* Arithmetic */
25919 #if CYTHON_CCOMPLEX
25920 #else
25921  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25922  return (a.real == b.real) && (a.imag == b.imag);
25923  }
25924  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25925  __pyx_t_double_complex z;
25926  z.real = a.real + b.real;
25927  z.imag = a.imag + b.imag;
25928  return z;
25929  }
25930  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25931  __pyx_t_double_complex z;
25932  z.real = a.real - b.real;
25933  z.imag = a.imag - b.imag;
25934  return z;
25935  }
25936  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25937  __pyx_t_double_complex z;
25938  z.real = a.real * b.real - a.imag * b.imag;
25939  z.imag = a.real * b.imag + a.imag * b.real;
25940  return z;
25941  }
25942  #if 1
25943  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25944  if (b.imag == 0) {
25945  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
25946  } else if (fabs(b.real) >= fabs(b.imag)) {
25947  if (b.real == 0 && b.imag == 0) {
25948  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
25949  } else {
25950  double r = b.imag / b.real;
25951  double s = (double)(1.0) / (b.real + b.imag * r);
25952  return __pyx_t_double_complex_from_parts(
25953  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
25954  }
25955  } else {
25956  double r = b.real / b.imag;
25957  double s = (double)(1.0) / (b.imag + b.real * r);
25958  return __pyx_t_double_complex_from_parts(
25959  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
25960  }
25961  }
25962  #else
25963  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25964  if (b.imag == 0) {
25965  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
25966  } else {
25967  double denom = b.real * b.real + b.imag * b.imag;
25968  return __pyx_t_double_complex_from_parts(
25969  (a.real * b.real + a.imag * b.imag) / denom,
25970  (a.imag * b.real - a.real * b.imag) / denom);
25971  }
25972  }
25973  #endif
25974  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
25975  __pyx_t_double_complex z;
25976  z.real = -a.real;
25977  z.imag = -a.imag;
25978  return z;
25979  }
25980  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
25981  return (a.real == 0) && (a.imag == 0);
25982  }
25983  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
25984  __pyx_t_double_complex z;
25985  z.real = a.real;
25986  z.imag = -a.imag;
25987  return z;
25988  }
25989  #if 1
25990  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
25991  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
25992  return sqrt(z.real*z.real + z.imag*z.imag);
25993  #else
25994  return hypot(z.real, z.imag);
25995  #endif
25996  }
25997  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25998  __pyx_t_double_complex z;
25999  double r, lnr, theta, z_r, z_theta;
26000  if (b.imag == 0 && b.real == (int)b.real) {
26001  if (b.real < 0) {
26002  double denom = a.real * a.real + a.imag * a.imag;
26003  a.real = a.real / denom;
26004  a.imag = -a.imag / denom;
26005  b.real = -b.real;
26006  }
26007  switch ((int)b.real) {
26008  case 0:
26009  z.real = 1;
26010  z.imag = 0;
26011  return z;
26012  case 1:
26013  return a;
26014  case 2:
26015  return __Pyx_c_prod_double(a, a);
26016  case 3:
26017  z = __Pyx_c_prod_double(a, a);
26018  return __Pyx_c_prod_double(z, a);
26019  case 4:
26020  z = __Pyx_c_prod_double(a, a);
26021  return __Pyx_c_prod_double(z, z);
26022  }
26023  }
26024  if (a.imag == 0) {
26025  if (a.real == 0) {
26026  return a;
26027  } else if (b.imag == 0) {
26028  z.real = pow(a.real, b.real);
26029  z.imag = 0;
26030  return z;
26031  } else if (a.real > 0) {
26032  r = a.real;
26033  theta = 0;
26034  } else {
26035  r = -a.real;
26036  theta = atan2(0.0, -1.0);
26037  }
26038  } else {
26039  r = __Pyx_c_abs_double(a);
26040  theta = atan2(a.imag, a.real);
26041  }
26042  lnr = log(r);
26043  z_r = exp(lnr * b.real - theta * b.imag);
26044  z_theta = theta * b.real + lnr * b.imag;
26045  z.real = z_r * cos(z_theta);
26046  z.imag = z_r * sin(z_theta);
26047  return z;
26048  }
26049  #endif
26050 #endif
26051 
26052 /* CIntToPy */
26053 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
26054  const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
26055  const int is_unsigned = neg_one > const_zero;
26056  if (is_unsigned) {
26057  if (sizeof(enum NPY_TYPES) < sizeof(long)) {
26058  return PyInt_FromLong((long) value);
26059  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
26060  return PyLong_FromUnsignedLong((unsigned long) value);
26061 #ifdef HAVE_LONG_LONG
26062  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
26063  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
26064 #endif
26065  }
26066  } else {
26067  if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
26068  return PyInt_FromLong((long) value);
26069 #ifdef HAVE_LONG_LONG
26070  } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
26071  return PyLong_FromLongLong((PY_LONG_LONG) value);
26072 #endif
26073  }
26074  }
26075  {
26076  int one = 1; int little = (int)*(unsigned char *)&one;
26077  unsigned char *bytes = (unsigned char *)&value;
26078  return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
26079  little, !is_unsigned);
26080  }
26081 }
26082 
26083 #if PY_MAJOR_VERSION < 3
26084 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
26085  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
26086  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
26087  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
26088  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26089  return -1;
26090 }
26091 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26092  PyObject *obj = view->obj;
26093  if (!obj) return;
26094  if (PyObject_CheckBuffer(obj)) {
26095  PyBuffer_Release(view);
26096  return;
26097  }
26098  if ((0)) {}
26099  view->obj = NULL;
26100  Py_DECREF(obj);
26101 }
26102 #endif
26103 
26104 
26105 /* MemviewSliceIsContig */
26106 static int
26107 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
26108 {
26109  int i, index, step, start;
26110  Py_ssize_t itemsize = mvs.memview->view.itemsize;
26111  if (order == 'F') {
26112  step = 1;
26113  start = 0;
26114  } else {
26115  step = -1;
26116  start = ndim - 1;
26117  }
26118  for (i = 0; i < ndim; i++) {
26119  index = start + step * i;
26120  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26121  return 0;
26122  itemsize *= mvs.shape[index];
26123  }
26124  return 1;
26125 }
26126 
26127 /* OverlappingSlices */
26128 static void
26129 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26130  void **out_start, void **out_end,
26131  int ndim, size_t itemsize)
26132 {
26133  char *start, *end;
26134  int i;
26135  start = end = slice->data;
26136  for (i = 0; i < ndim; i++) {
26137  Py_ssize_t stride = slice->strides[i];
26138  Py_ssize_t extent = slice->shape[i];
26139  if (extent == 0) {
26140  *out_start = *out_end = start;
26141  return;
26142  } else {
26143  if (stride > 0)
26144  end += stride * (extent - 1);
26145  else
26146  start += stride * (extent - 1);
26147  }
26148  }
26149  *out_start = start;
26150  *out_end = end + itemsize;
26151 }
26152 static int
26153 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26154  __Pyx_memviewslice *slice2,
26155  int ndim, size_t itemsize)
26156 {
26157  void *start1, *end1, *start2, *end2;
26158  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26159  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26160  return (start1 < end2) && (start2 < end1);
26161 }
26162 
26163 /* Capsule */
26164 static CYTHON_INLINE PyObject *
26165 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
26166 {
26167  PyObject *cobj;
26168 #if PY_VERSION_HEX >= 0x02070000
26169  cobj = PyCapsule_New(p, sig, NULL);
26170 #else
26171  cobj = PyCObject_FromVoidPtr(p, NULL);
26172 #endif
26173  return cobj;
26174 }
26175 
26176 /* CIntFromPy */
26177 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
26178  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
26179  const int is_unsigned = neg_one > const_zero;
26180 #if PY_MAJOR_VERSION < 3
26181  if (likely(PyInt_Check(x))) {
26182  if (sizeof(int) < sizeof(long)) {
26183  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
26184  } else {
26185  long val = PyInt_AS_LONG(x);
26186  if (is_unsigned && unlikely(val < 0)) {
26187  goto raise_neg_overflow;
26188  }
26189  return (int) val;
26190  }
26191  } else
26192 #endif
26193  if (likely(PyLong_Check(x))) {
26194  if (is_unsigned) {
26195 #if CYTHON_USE_PYLONG_INTERNALS
26196  const digit* digits = ((PyLongObject*)x)->ob_digit;
26197  switch (Py_SIZE(x)) {
26198  case 0: return (int) 0;
26199  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
26200  case 2:
26201  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
26202  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26203  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26204  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
26205  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26206  }
26207  }
26208  break;
26209  case 3:
26210  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
26211  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26212  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26213  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
26214  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26215  }
26216  }
26217  break;
26218  case 4:
26219  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
26220  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26221  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26222  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
26223  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26224  }
26225  }
26226  break;
26227  }
26228 #endif
26229 #if CYTHON_COMPILING_IN_CPYTHON
26230  if (unlikely(Py_SIZE(x) < 0)) {
26231  goto raise_neg_overflow;
26232  }
26233 #else
26234  {
26235  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26236  if (unlikely(result < 0))
26237  return (int) -1;
26238  if (unlikely(result == 1))
26239  goto raise_neg_overflow;
26240  }
26241 #endif
26242  if (sizeof(int) <= sizeof(unsigned long)) {
26243  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
26244 #ifdef HAVE_LONG_LONG
26245  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
26246  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26247 #endif
26248  }
26249  } else {
26250 #if CYTHON_USE_PYLONG_INTERNALS
26251  const digit* digits = ((PyLongObject*)x)->ob_digit;
26252  switch (Py_SIZE(x)) {
26253  case 0: return (int) 0;
26254  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
26255  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
26256  case -2:
26257  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
26258  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26259  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26260  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26261  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26262  }
26263  }
26264  break;
26265  case 2:
26266  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
26267  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26268  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26269  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26270  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26271  }
26272  }
26273  break;
26274  case -3:
26275  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26276  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26277  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26278  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26279  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26280  }
26281  }
26282  break;
26283  case 3:
26284  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
26285  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26286  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26287  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26288  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26289  }
26290  }
26291  break;
26292  case -4:
26293  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26294  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26295  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26296  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
26297  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26298  }
26299  }
26300  break;
26301  case 4:
26302  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
26303  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26304  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26305  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
26306  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26307  }
26308  }
26309  break;
26310  }
26311 #endif
26312  if (sizeof(int) <= sizeof(long)) {
26313  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
26314 #ifdef HAVE_LONG_LONG
26315  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
26316  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
26317 #endif
26318  }
26319  }
26320  {
26321 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26322  PyErr_SetString(PyExc_RuntimeError,
26323  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26324 #else
26325  int val;
26326  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
26327  #if PY_MAJOR_VERSION < 3
26328  if (likely(v) && !PyLong_Check(v)) {
26329  PyObject *tmp = v;
26330  v = PyNumber_Long(tmp);
26331  Py_DECREF(tmp);
26332  }
26333  #endif
26334  if (likely(v)) {
26335  int one = 1; int is_little = (int)*(unsigned char *)&one;
26336  unsigned char *bytes = (unsigned char *)&val;
26337  int ret = _PyLong_AsByteArray((PyLongObject *)v,
26338  bytes, sizeof(val),
26339  is_little, !is_unsigned);
26340  Py_DECREF(v);
26341  if (likely(!ret))
26342  return val;
26343  }
26344 #endif
26345  return (int) -1;
26346  }
26347  } else {
26348  int val;
26349  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26350  if (!tmp) return (int) -1;
26351  val = __Pyx_PyInt_As_int(tmp);
26352  Py_DECREF(tmp);
26353  return val;
26354  }
26355 raise_overflow:
26356  PyErr_SetString(PyExc_OverflowError,
26357  "value too large to convert to int");
26358  return (int) -1;
26359 raise_neg_overflow:
26360  PyErr_SetString(PyExc_OverflowError,
26361  "can't convert negative value to int");
26362  return (int) -1;
26363 }
26364 
26365 /* TypeInfoToFormat */
26366 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) {
26367  struct __pyx_typeinfo_string result = { {0} };
26368  char *buf = (char *) result.string;
26369  size_t size = type->size;
26370  switch (type->typegroup) {
26371  case 'H':
26372  *buf = 'c';
26373  break;
26374  case 'I':
26375  case 'U':
26376  if (size == 1)
26377  *buf = (type->is_unsigned) ? 'B' : 'b';
26378  else if (size == 2)
26379  *buf = (type->is_unsigned) ? 'H' : 'h';
26380  else if (size == 4)
26381  *buf = (type->is_unsigned) ? 'I' : 'i';
26382  else if (size == 8)
26383  *buf = (type->is_unsigned) ? 'Q' : 'q';
26384  break;
26385  case 'P':
26386  *buf = 'P';
26387  break;
26388  case 'C':
26389  {
26390  __Pyx_TypeInfo complex_type = *type;
26391  complex_type.typegroup = 'R';
26392  complex_type.size /= 2;
26393  *buf++ = 'Z';
26394  *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
26395  break;
26396  }
26397  case 'R':
26398  if (size == 4)
26399  *buf = 'f';
26400  else if (size == 8)
26401  *buf = 'd';
26402  else
26403  *buf = 'g';
26404  break;
26405  }
26406  return result;
26407 }
26408 
26409 /* MemviewSliceCopyTemplate */
26410 static __Pyx_memviewslice
26411 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
26412  const char *mode, int ndim,
26413  size_t sizeof_dtype, int contig_flag,
26414  int dtype_is_object)
26415 {
26416  __Pyx_RefNannyDeclarations
26417  int i;
26418  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
26419  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
26420  Py_buffer *buf = &from_memview->view;
26421  PyObject *shape_tuple = NULL;
26422  PyObject *temp_int = NULL;
26423  struct __pyx_array_obj *array_obj = NULL;
26424  struct __pyx_memoryview_obj *memview_obj = NULL;
26425  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
26426  for (i = 0; i < ndim; i++) {
26427  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
26428  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
26429  "indirect dimensions (axis %d)", i);
26430  goto fail;
26431  }
26432  }
26433  shape_tuple = PyTuple_New(ndim);
26434  if (unlikely(!shape_tuple)) {
26435  goto fail;
26436  }
26437  __Pyx_GOTREF(shape_tuple);
26438  for(i = 0; i < ndim; i++) {
26439  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
26440  if(unlikely(!temp_int)) {
26441  goto fail;
26442  } else {
26443  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
26444  temp_int = NULL;
26445  }
26446  }
26447  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
26448  if (unlikely(!array_obj)) {
26449  goto fail;
26450  }
26451  __Pyx_GOTREF(array_obj);
26452  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26453  (PyObject *) array_obj, contig_flag,
26454  dtype_is_object,
26455  from_mvs->memview->typeinfo);
26456  if (unlikely(!memview_obj))
26457  goto fail;
26458  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
26459  goto fail;
26460  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
26461  dtype_is_object) < 0))
26462  goto fail;
26463  goto no_fail;
26464 fail:
26465  __Pyx_XDECREF(new_mvs.memview);
26466  new_mvs.memview = NULL;
26467  new_mvs.data = NULL;
26468 no_fail:
26469  __Pyx_XDECREF(shape_tuple);
26470  __Pyx_XDECREF(temp_int);
26471  __Pyx_XDECREF(array_obj);
26472  __Pyx_RefNannyFinishContext();
26473  return new_mvs;
26474 }
26475 
26476 /* MemviewSliceInit */
26477 static int
26478 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
26479  int ndim,
26480  __Pyx_memviewslice *memviewslice,
26481  int memview_is_new_reference)
26482 {
26483  __Pyx_RefNannyDeclarations
26484  int i, retval=-1;
26485  Py_buffer *buf = &memview->view;
26486  __Pyx_RefNannySetupContext("init_memviewslice", 0);
26487  if (unlikely(memviewslice->memview || memviewslice->data)) {
26488  PyErr_SetString(PyExc_ValueError,
26489  "memviewslice is already initialized!");
26490  goto fail;
26491  }
26492  if (buf->strides) {
26493  for (i = 0; i < ndim; i++) {
26494  memviewslice->strides[i] = buf->strides[i];
26495  }
26496  } else {
26497  Py_ssize_t stride = buf->itemsize;
26498  for (i = ndim - 1; i >= 0; i--) {
26499  memviewslice->strides[i] = stride;
26500  stride *= buf->shape[i];
26501  }
26502  }
26503  for (i = 0; i < ndim; i++) {
26504  memviewslice->shape[i] = buf->shape[i];
26505  if (buf->suboffsets) {
26506  memviewslice->suboffsets[i] = buf->suboffsets[i];
26507  } else {
26508  memviewslice->suboffsets[i] = -1;
26509  }
26510  }
26511  memviewslice->memview = memview;
26512  memviewslice->data = (char *)buf->buf;
26513  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
26514  Py_INCREF(memview);
26515  }
26516  retval = 0;
26517  goto no_fail;
26518 fail:
26519  memviewslice->memview = 0;
26520  memviewslice->data = 0;
26521  retval = -1;
26522 no_fail:
26523  __Pyx_RefNannyFinishContext();
26524  return retval;
26525 }
26526 #ifndef Py_NO_RETURN
26527 #define Py_NO_RETURN
26528 #endif
26529 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
26530  va_list vargs;
26531  char msg[200];
26532 #ifdef HAVE_STDARG_PROTOTYPES
26533  va_start(vargs, fmt);
26534 #else
26535  va_start(vargs);
26536 #endif
26537  vsnprintf(msg, 200, fmt, vargs);
26538  va_end(vargs);
26539  Py_FatalError(msg);
26540 }
26541 static CYTHON_INLINE int
26542 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
26543  PyThread_type_lock lock)
26544 {
26545  int result;
26546  PyThread_acquire_lock(lock, 1);
26547  result = (*acquisition_count)++;
26548  PyThread_release_lock(lock);
26549  return result;
26550 }
26551 static CYTHON_INLINE int
26552 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
26553  PyThread_type_lock lock)
26554 {
26555  int result;
26556  PyThread_acquire_lock(lock, 1);
26557  result = (*acquisition_count)--;
26558  PyThread_release_lock(lock);
26559  return result;
26560 }
26561 static CYTHON_INLINE void
26562 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
26563 {
26564  int first_time;
26565  struct __pyx_memoryview_obj *memview = memslice->memview;
26566  if (unlikely(!memview || (PyObject *) memview == Py_None))
26567  return;
26568  if (unlikely(__pyx_get_slice_count(memview) < 0))
26569  __pyx_fatalerror("Acquisition count is %d (line %d)",
26570  __pyx_get_slice_count(memview), lineno);
26571  first_time = __pyx_add_acquisition_count(memview) == 0;
26572  if (unlikely(first_time)) {
26573  if (have_gil) {
26574  Py_INCREF((PyObject *) memview);
26575  } else {
26576  PyGILState_STATE _gilstate = PyGILState_Ensure();
26577  Py_INCREF((PyObject *) memview);
26578  PyGILState_Release(_gilstate);
26579  }
26580  }
26581 }
26582 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
26583  int have_gil, int lineno) {
26584  int last_time;
26585  struct __pyx_memoryview_obj *memview = memslice->memview;
26586  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
26587  memslice->memview = NULL;
26588  return;
26589  }
26590  if (unlikely(__pyx_get_slice_count(memview) <= 0))
26591  __pyx_fatalerror("Acquisition count is %d (line %d)",
26592  __pyx_get_slice_count(memview), lineno);
26593  last_time = __pyx_sub_acquisition_count(memview) == 1;
26594  memslice->data = NULL;
26595  if (unlikely(last_time)) {
26596  if (have_gil) {
26597  Py_CLEAR(memslice->memview);
26598  } else {
26599  PyGILState_STATE _gilstate = PyGILState_Ensure();
26600  Py_CLEAR(memslice->memview);
26601  PyGILState_Release(_gilstate);
26602  }
26603  } else {
26604  memslice->memview = NULL;
26605  }
26606 }
26607 
26608 /* CIntFromPy */
26609 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
26610  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
26611  const int is_unsigned = neg_one > const_zero;
26612 #if PY_MAJOR_VERSION < 3
26613  if (likely(PyInt_Check(x))) {
26614  if (sizeof(long) < sizeof(long)) {
26615  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
26616  } else {
26617  long val = PyInt_AS_LONG(x);
26618  if (is_unsigned && unlikely(val < 0)) {
26619  goto raise_neg_overflow;
26620  }
26621  return (long) val;
26622  }
26623  } else
26624 #endif
26625  if (likely(PyLong_Check(x))) {
26626  if (is_unsigned) {
26627 #if CYTHON_USE_PYLONG_INTERNALS
26628  const digit* digits = ((PyLongObject*)x)->ob_digit;
26629  switch (Py_SIZE(x)) {
26630  case 0: return (long) 0;
26631  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
26632  case 2:
26633  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
26634  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26635  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26636  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
26637  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
26638  }
26639  }
26640  break;
26641  case 3:
26642  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
26643  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26644  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26645  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
26646  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
26647  }
26648  }
26649  break;
26650  case 4:
26651  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
26652  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26653  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26654  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
26655  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
26656  }
26657  }
26658  break;
26659  }
26660 #endif
26661 #if CYTHON_COMPILING_IN_CPYTHON
26662  if (unlikely(Py_SIZE(x) < 0)) {
26663  goto raise_neg_overflow;
26664  }
26665 #else
26666  {
26667  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26668  if (unlikely(result < 0))
26669  return (long) -1;
26670  if (unlikely(result == 1))
26671  goto raise_neg_overflow;
26672  }
26673 #endif
26674  if (sizeof(long) <= sizeof(unsigned long)) {
26675  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
26676 #ifdef HAVE_LONG_LONG
26677  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
26678  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26679 #endif
26680  }
26681  } else {
26682 #if CYTHON_USE_PYLONG_INTERNALS
26683  const digit* digits = ((PyLongObject*)x)->ob_digit;
26684  switch (Py_SIZE(x)) {
26685  case 0: return (long) 0;
26686  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
26687  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
26688  case -2:
26689  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
26690  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26691  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26692  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26693  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26694  }
26695  }
26696  break;
26697  case 2:
26698  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
26699  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26700  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26701  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26702  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26703  }
26704  }
26705  break;
26706  case -3:
26707  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26708  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26709  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26710  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26711  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26712  }
26713  }
26714  break;
26715  case 3:
26716  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
26717  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26718  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26719  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26720  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26721  }
26722  }
26723  break;
26724  case -4:
26725  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26726  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26727  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26728  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
26729  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26730  }
26731  }
26732  break;
26733  case 4:
26734  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
26735  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26736  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26737  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
26738  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26739  }
26740  }
26741  break;
26742  }
26743 #endif
26744  if (sizeof(long) <= sizeof(long)) {
26745  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
26746 #ifdef HAVE_LONG_LONG
26747  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
26748  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
26749 #endif
26750  }
26751  }
26752  {
26753 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26754  PyErr_SetString(PyExc_RuntimeError,
26755  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26756 #else
26757  long val;
26758  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
26759  #if PY_MAJOR_VERSION < 3
26760  if (likely(v) && !PyLong_Check(v)) {
26761  PyObject *tmp = v;
26762  v = PyNumber_Long(tmp);
26763  Py_DECREF(tmp);
26764  }
26765  #endif
26766  if (likely(v)) {
26767  int one = 1; int is_little = (int)*(unsigned char *)&one;
26768  unsigned char *bytes = (unsigned char *)&val;
26769  int ret = _PyLong_AsByteArray((PyLongObject *)v,
26770  bytes, sizeof(val),
26771  is_little, !is_unsigned);
26772  Py_DECREF(v);
26773  if (likely(!ret))
26774  return val;
26775  }
26776 #endif
26777  return (long) -1;
26778  }
26779  } else {
26780  long val;
26781  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26782  if (!tmp) return (long) -1;
26783  val = __Pyx_PyInt_As_long(tmp);
26784  Py_DECREF(tmp);
26785  return val;
26786  }
26787 raise_overflow:
26788  PyErr_SetString(PyExc_OverflowError,
26789  "value too large to convert to long");
26790  return (long) -1;
26791 raise_neg_overflow:
26792  PyErr_SetString(PyExc_OverflowError,
26793  "can't convert negative value to long");
26794  return (long) -1;
26795 }
26796 
26797 /* CIntToPy */
26798 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
26799  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
26800  const int is_unsigned = neg_one > const_zero;
26801  if (is_unsigned) {
26802  if (sizeof(long) < sizeof(long)) {
26803  return PyInt_FromLong((long) value);
26804  } else if (sizeof(long) <= sizeof(unsigned long)) {
26805  return PyLong_FromUnsignedLong((unsigned long) value);
26806 #ifdef HAVE_LONG_LONG
26807  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
26808  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
26809 #endif
26810  }
26811  } else {
26812  if (sizeof(long) <= sizeof(long)) {
26813  return PyInt_FromLong((long) value);
26814 #ifdef HAVE_LONG_LONG
26815  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
26816  return PyLong_FromLongLong((PY_LONG_LONG) value);
26817 #endif
26818  }
26819  }
26820  {
26821  int one = 1; int little = (int)*(unsigned char *)&one;
26822  unsigned char *bytes = (unsigned char *)&value;
26823  return _PyLong_FromByteArray(bytes, sizeof(long),
26824  little, !is_unsigned);
26825  }
26826 }
26827 
26828 /* CIntFromPy */
26829 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
26830  const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
26831  const int is_unsigned = neg_one > const_zero;
26832 #if PY_MAJOR_VERSION < 3
26833  if (likely(PyInt_Check(x))) {
26834  if (sizeof(char) < sizeof(long)) {
26835  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
26836  } else {
26837  long val = PyInt_AS_LONG(x);
26838  if (is_unsigned && unlikely(val < 0)) {
26839  goto raise_neg_overflow;
26840  }
26841  return (char) val;
26842  }
26843  } else
26844 #endif
26845  if (likely(PyLong_Check(x))) {
26846  if (is_unsigned) {
26847 #if CYTHON_USE_PYLONG_INTERNALS
26848  const digit* digits = ((PyLongObject*)x)->ob_digit;
26849  switch (Py_SIZE(x)) {
26850  case 0: return (char) 0;
26851  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
26852  case 2:
26853  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
26854  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26855  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26856  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
26857  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
26858  }
26859  }
26860  break;
26861  case 3:
26862  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
26863  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26864  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26865  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
26866  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
26867  }
26868  }
26869  break;
26870  case 4:
26871  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
26872  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26873  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26874  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
26875  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
26876  }
26877  }
26878  break;
26879  }
26880 #endif
26881 #if CYTHON_COMPILING_IN_CPYTHON
26882  if (unlikely(Py_SIZE(x) < 0)) {
26883  goto raise_neg_overflow;
26884  }
26885 #else
26886  {
26887  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26888  if (unlikely(result < 0))
26889  return (char) -1;
26890  if (unlikely(result == 1))
26891  goto raise_neg_overflow;
26892  }
26893 #endif
26894  if (sizeof(char) <= sizeof(unsigned long)) {
26895  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
26896 #ifdef HAVE_LONG_LONG
26897  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
26898  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26899 #endif
26900  }
26901  } else {
26902 #if CYTHON_USE_PYLONG_INTERNALS
26903  const digit* digits = ((PyLongObject*)x)->ob_digit;
26904  switch (Py_SIZE(x)) {
26905  case 0: return (char) 0;
26906  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
26907  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
26908  case -2:
26909  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
26910  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26911  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26912  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
26913  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
26914  }
26915  }
26916  break;
26917  case 2:
26918  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
26919  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26920  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26921  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
26922  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
26923  }
26924  }
26925  break;
26926  case -3:
26927  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
26928  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26929  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26930  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
26931  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
26932  }
26933  }
26934  break;
26935  case 3:
26936  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
26937  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26938  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26939  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
26940  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
26941  }
26942  }
26943  break;
26944  case -4:
26945  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
26946  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26947  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26948  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
26949  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
26950  }
26951  }
26952  break;
26953  case 4:
26954  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
26955  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26956  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26957  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
26958  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
26959  }
26960  }
26961  break;
26962  }
26963 #endif
26964  if (sizeof(char) <= sizeof(long)) {
26965  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
26966 #ifdef HAVE_LONG_LONG
26967  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
26968  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
26969 #endif
26970  }
26971  }
26972  {
26973 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26974  PyErr_SetString(PyExc_RuntimeError,
26975  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26976 #else
26977  char val;
26978  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
26979  #if PY_MAJOR_VERSION < 3
26980  if (likely(v) && !PyLong_Check(v)) {
26981  PyObject *tmp = v;
26982  v = PyNumber_Long(tmp);
26983  Py_DECREF(tmp);
26984  }
26985  #endif
26986  if (likely(v)) {
26987  int one = 1; int is_little = (int)*(unsigned char *)&one;
26988  unsigned char *bytes = (unsigned char *)&val;
26989  int ret = _PyLong_AsByteArray((PyLongObject *)v,
26990  bytes, sizeof(val),
26991  is_little, !is_unsigned);
26992  Py_DECREF(v);
26993  if (likely(!ret))
26994  return val;
26995  }
26996 #endif
26997  return (char) -1;
26998  }
26999  } else {
27000  char val;
27001  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27002  if (!tmp) return (char) -1;
27003  val = __Pyx_PyInt_As_char(tmp);
27004  Py_DECREF(tmp);
27005  return val;
27006  }
27007 raise_overflow:
27008  PyErr_SetString(PyExc_OverflowError,
27009  "value too large to convert to char");
27010  return (char) -1;
27011 raise_neg_overflow:
27012  PyErr_SetString(PyExc_OverflowError,
27013  "can't convert negative value to char");
27014  return (char) -1;
27015 }
27016 
27017 /* CheckBinaryVersion */
27018 static int __Pyx_check_binary_version(void) {
27019  char ctversion[4], rtversion[4];
27020  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
27021  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
27022  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
27023  char message[200];
27024  PyOS_snprintf(message, sizeof(message),
27025  "compiletime version %s of module '%.100s' "
27026  "does not match runtime version %s",
27027  ctversion, __Pyx_MODULE_NAME, rtversion);
27028  return PyErr_WarnEx(NULL, message, 1);
27029  }
27030  return 0;
27031 }
27032 
27033 /* InitStrings */
27034 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
27035  while (t->p) {
27036  #if PY_MAJOR_VERSION < 3
27037  if (t->is_unicode) {
27038  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
27039  } else if (t->intern) {
27040  *t->p = PyString_InternFromString(t->s);
27041  } else {
27042  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
27043  }
27044  #else
27045  if (t->is_unicode | t->is_str) {
27046  if (t->intern) {
27047  *t->p = PyUnicode_InternFromString(t->s);
27048  } else if (t->encoding) {
27049  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
27050  } else {
27051  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
27052  }
27053  } else {
27054  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
27055  }
27056  #endif
27057  if (!*t->p)
27058  return -1;
27059  if (PyObject_Hash(*t->p) == -1)
27060  return -1;
27061  ++t;
27062  }
27063  return 0;
27064 }
27065 
27066 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
27067  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
27068 }
27069 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
27070  Py_ssize_t ignore;
27071  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
27072 }
27073 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27074 #if !CYTHON_PEP393_ENABLED
27075 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27076  char* defenc_c;
27077  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
27078  if (!defenc) return NULL;
27079  defenc_c = PyBytes_AS_STRING(defenc);
27080 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27081  {
27082  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
27083  char* c;
27084  for (c = defenc_c; c < end; c++) {
27085  if ((unsigned char) (*c) >= 128) {
27086  PyUnicode_AsASCIIString(o);
27087  return NULL;
27088  }
27089  }
27090  }
27091 #endif
27092  *length = PyBytes_GET_SIZE(defenc);
27093  return defenc_c;
27094 }
27095 #else
27096 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27097  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
27098 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27099  if (likely(PyUnicode_IS_ASCII(o))) {
27100  *length = PyUnicode_GET_LENGTH(o);
27101  return PyUnicode_AsUTF8(o);
27102  } else {
27103  PyUnicode_AsASCIIString(o);
27104  return NULL;
27105  }
27106 #else
27107  return PyUnicode_AsUTF8AndSize(o, length);
27108 #endif
27109 }
27110 #endif
27111 #endif
27112 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27113 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27114  if (
27115 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27116  __Pyx_sys_getdefaultencoding_not_ascii &&
27117 #endif
27118  PyUnicode_Check(o)) {
27119  return __Pyx_PyUnicode_AsStringAndSize(o, length);
27120  } else
27121 #endif
27122 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
27123  if (PyByteArray_Check(o)) {
27124  *length = PyByteArray_GET_SIZE(o);
27125  return PyByteArray_AS_STRING(o);
27126  } else
27127 #endif
27128  {
27129  char* result;
27130  int r = PyBytes_AsStringAndSize(o, &result, length);
27131  if (unlikely(r < 0)) {
27132  return NULL;
27133  } else {
27134  return result;
27135  }
27136  }
27137 }
27138 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
27139  int is_true = x == Py_True;
27140  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
27141  else return PyObject_IsTrue(x);
27142 }
27143 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
27144  int retval;
27145  if (unlikely(!x)) return -1;
27146  retval = __Pyx_PyObject_IsTrue(x);
27147  Py_DECREF(x);
27148  return retval;
27149 }
27150 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
27151 #if PY_MAJOR_VERSION >= 3
27152  if (PyLong_Check(result)) {
27153  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
27154  "__int__ returned non-int (type %.200s). "
27155  "The ability to return an instance of a strict subclass of int "
27156  "is deprecated, and may be removed in a future version of Python.",
27157  Py_TYPE(result)->tp_name)) {
27158  Py_DECREF(result);
27159  return NULL;
27160  }
27161  return result;
27162  }
27163 #endif
27164  PyErr_Format(PyExc_TypeError,
27165  "__%.4s__ returned non-%.4s (type %.200s)",
27166  type_name, type_name, Py_TYPE(result)->tp_name);
27167  Py_DECREF(result);
27168  return NULL;
27169 }
27170 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
27171 #if CYTHON_USE_TYPE_SLOTS
27172  PyNumberMethods *m;
27173 #endif
27174  const char *name = NULL;
27175  PyObject *res = NULL;
27176 #if PY_MAJOR_VERSION < 3
27177  if (likely(PyInt_Check(x) || PyLong_Check(x)))
27178 #else
27179  if (likely(PyLong_Check(x)))
27180 #endif
27181  return __Pyx_NewRef(x);
27182 #if CYTHON_USE_TYPE_SLOTS
27183  m = Py_TYPE(x)->tp_as_number;
27184  #if PY_MAJOR_VERSION < 3
27185  if (m && m->nb_int) {
27186  name = "int";
27187  res = m->nb_int(x);
27188  }
27189  else if (m && m->nb_long) {
27190  name = "long";
27191  res = m->nb_long(x);
27192  }
27193  #else
27194  if (likely(m && m->nb_int)) {
27195  name = "int";
27196  res = m->nb_int(x);
27197  }
27198  #endif
27199 #else
27200  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
27201  res = PyNumber_Int(x);
27202  }
27203 #endif
27204  if (likely(res)) {
27205 #if PY_MAJOR_VERSION < 3
27206  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
27207 #else
27208  if (unlikely(!PyLong_CheckExact(res))) {
27209 #endif
27210  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
27211  }
27212  }
27213  else if (!PyErr_Occurred()) {
27214  PyErr_SetString(PyExc_TypeError,
27215  "an integer is required");
27216  }
27217  return res;
27218 }
27219 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
27220  Py_ssize_t ival;
27221  PyObject *x;
27222 #if PY_MAJOR_VERSION < 3
27223  if (likely(PyInt_CheckExact(b))) {
27224  if (sizeof(Py_ssize_t) >= sizeof(long))
27225  return PyInt_AS_LONG(b);
27226  else
27227  return PyInt_AsSsize_t(b);
27228  }
27229 #endif
27230  if (likely(PyLong_CheckExact(b))) {
27231  #if CYTHON_USE_PYLONG_INTERNALS
27232  const digit* digits = ((PyLongObject*)b)->ob_digit;
27233  const Py_ssize_t size = Py_SIZE(b);
27234  if (likely(__Pyx_sst_abs(size) <= 1)) {
27235  ival = likely(size) ? digits[0] : 0;
27236  if (size == -1) ival = -ival;
27237  return ival;
27238  } else {
27239  switch (size) {
27240  case 2:
27241  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27242  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27243  }
27244  break;
27245  case -2:
27246  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27247  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27248  }
27249  break;
27250  case 3:
27251  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27252  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27253  }
27254  break;
27255  case -3:
27256  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27257  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27258  }
27259  break;
27260  case 4:
27261  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27262  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27263  }
27264  break;
27265  case -4:
27266  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27267  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27268  }
27269  break;
27270  }
27271  }
27272  #endif
27273  return PyLong_AsSsize_t(b);
27274  }
27275  x = PyNumber_Index(b);
27276  if (!x) return -1;
27277  ival = PyInt_AsSsize_t(x);
27278  Py_DECREF(x);
27279  return ival;
27280 }
27281 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
27282  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
27283 }
27284 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
27285  return PyInt_FromSize_t(ival);
27286 }
27287 
27288 
27289 #endif /* Py_PYTHON_H */
Mesh::nodeDiametersArray
double * nodeDiametersArray
Definition: mesh.h:69
proteus::partitionElements
int partitionElements(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, int nElements_overlap)
Definition: partitioning.cpp:2960
Mesh::interiorElementBoundariesArray
int * interiorElementBoundariesArray
Definition: mesh.h:50
Mesh::elementBoundaryNodesArray
int * elementBoundaryNodesArray
Definition: mesh.h:47
Mesh::nodeArray
double * nodeArray
Definition: mesh.h:67
Mesh::nodeElementsArray
int * nodeElementsArray
Definition: mesh.h:43
Mesh::max_nElements_node
int max_nElements_node
Definition: mesh.h:38
Mesh::pz
int pz
Definition: mesh.h:64
Mesh::nodeElementOffsets
int * nodeElementOffsets
Definition: mesh.h:44
proteus::buildQuadraticSubdomain2GlobalMappings_2d
int buildQuadraticSubdomain2GlobalMappings_2d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementBoundaryOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *elementBoundaryNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Definition: partitioning.cpp:4147
Mesh
Definition: mesh.h:28
Mesh::nEdges_global
int nEdges_global
Definition: mesh.h:39
Mesh::exteriorElementBoundariesArray
int * exteriorElementBoundariesArray
Definition: mesh.h:51
f
Double f
Definition: Headers.h:64
s
Double s
Definition: Headers.h:84
Mesh::nodeStarOffsets
int * nodeStarOffsets
Definition: mesh.h:54
Mesh::volume
double volume
Definition: mesh.h:70
Mesh::nNodes_elementBoundary
int nNodes_elementBoundary
Definition: mesh.h:33
Mesh::nElementBoundaries_global
int nElementBoundaries_global
Definition: mesh.h:35
partitioning.h
Mesh::hMin
double hMin
Definition: mesh.h:70
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
q
Double q
Definition: Headers.h:81
proteus::buildQuadraticCubeSubdomain2GlobalMappings_3d
int buildQuadraticCubeSubdomain2GlobalMappings_3d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *edgeOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *edgeNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Definition: partitioning.cpp:4585
proteus::buildQuadraticSubdomain2GlobalMappings_1d
int buildQuadraticSubdomain2GlobalMappings_1d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *elementNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Definition: partitioning.cpp:3995
Mesh::nInteriorElementBoundaries_global
int nInteriorElementBoundaries_global
Definition: mesh.h:36
Mesh::ny
int ny
Definition: mesh.h:63
Mesh::nodeStarArray
int * nodeStarArray
Definition: mesh.h:53
Mesh::h
double h
Definition: mesh.h:70
Mesh::nNodes_element
int nNodes_element
Definition: mesh.h:32
Mesh::elementBoundaryLocalElementBoundariesArray
int * elementBoundaryLocalElementBoundariesArray
Definition: mesh.h:49
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
Mesh::elementBoundaryMaterialTypes
int * elementBoundaryMaterialTypes
Definition: mesh.h:56
Mesh::elementInnerDiametersArray
double * elementInnerDiametersArray
Definition: mesh.h:67
T
Double T
Definition: Headers.h:87
Mesh::V_KNOT
double * V_KNOT
Definition: mesh.h:62
z
Double * z
Definition: Headers.h:49
proteus::buildQuadraticSubdomain2GlobalMappings_3d
int buildQuadraticSubdomain2GlobalMappings_3d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *edgeOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *edgeNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Definition: partitioning.cpp:4306
Mesh::elementNodesArray
int * elementNodesArray
Definition: mesh.h:42
u
Double u
Definition: Headers.h:89
Mesh::elementBoundaryBarycentersArray
double * elementBoundaryBarycentersArray
Definition: mesh.h:68
Mesh::py
int py
Definition: mesh.h:64
Mesh::nz
int nz
Definition: mesh.h:63
Mesh::elementBoundariesArray
int * elementBoundariesArray
Definition: mesh.h:46
Mesh::elementBarycentersArray
double * elementBarycentersArray
Definition: mesh.h:68
c
Double c
Definition: Headers.h:54
Mesh::nElements_global
int nElements_global
Definition: mesh.h:30
mesh.h
Mesh::nodeMaterialTypes
int * nodeMaterialTypes
Definition: mesh.h:57
proteus::partitionNodes
int partitionNodes(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, int nNodes_overlap)
Definition: partitioning.cpp:539
Mesh::nElementBoundaries_element
int nElementBoundaries_element
Definition: mesh.h:34
Mesh::elementMaterialTypes
int * elementMaterialTypes
Definition: mesh.h:55
Mesh::elementDiametersArray
double * elementDiametersArray
Definition: mesh.h:67
Mesh::nNodes_global
int nNodes_global
Definition: mesh.h:31
Mesh::nExteriorElementBoundaries_global
int nExteriorElementBoundaries_global
Definition: mesh.h:37
Mesh::px
int px
Definition: mesh.h:64
proteus::partitionNodesFromTetgenFiles
int partitionNodesFromTetgenFiles(const MPI_Comm &PROTEUS_COMM_WORLD, const char *filebase, int indexBase, Mesh &newMesh, int nNodes_overlap)
Definition: partitioning.cpp:1464
Mesh::W_KNOT
double * W_KNOT
Definition: mesh.h:62
Mesh::elementIJK
int * elementIJK
Definition: mesh.h:60
Mesh::max_nNodeNeighbors_node
int max_nNodeNeighbors_node
Definition: mesh.h:40
proteus::buildDiscontinuousGalerkinSubdomain2GlobalMappings
int buildDiscontinuousGalerkinSubdomain2GlobalMappings(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementOffsets_subdomain_owned, const int *elementNumbering_subdomain2global, int nDOF_element, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global)
Definition: partitioning.cpp:4959
Mesh::sigmaMax
double sigmaMax
Definition: mesh.h:70
Mesh::nodeSupportArray
double * nodeSupportArray
Definition: mesh.h:69
r
Double r
Definition: Headers.h:83
Mesh::weights
double * weights
Definition: mesh.h:61
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
Mesh::edgeNodesArray
int * edgeNodesArray
Definition: mesh.h:52
Mesh::nx
int nx
Definition: mesh.h:63
Mesh::elementBoundaryDiametersArray
double * elementBoundaryDiametersArray
Definition: mesh.h:67
Mesh::elementBoundaryElementsArray
int * elementBoundaryElementsArray
Definition: mesh.h:48
Mesh::elementNeighborsArray
int * elementNeighborsArray
Definition: mesh.h:45
Mesh::U_KNOT
double * U_KNOT
Definition: mesh.h:62